Бранимир Караџић 3 rokov pred
rodič
commit
819a2bf6b0

+ 3 - 2
include/bx/error.h

@@ -38,7 +38,7 @@ namespace bx
 	{
 		BX_CLASS(Error
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -105,8 +105,9 @@ namespace bx
 	class ErrorScope
 	{
 		BX_CLASS(ErrorScope
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:

+ 10 - 0
include/bx/inline/bx.inl

@@ -15,6 +15,14 @@ namespace bx
 	template<typename Ty, size_t NumT>
 	char (&CountOfRequireArrayArgumentT(const Ty (&)[NumT]) )[NumT];
 
+	struct Ignore
+	{
+		template <typename Ty>
+		constexpr void operator=(Ty&&) const
+		{
+		}
+	};
+
 	template<bool B>
 	struct isEnabled
 	{
@@ -148,3 +156,5 @@ namespace bx
 	}
 
 } // namespace bx
+
+constexpr bx::Ignore _;

+ 4 - 4
include/bx/macros.h

@@ -199,13 +199,13 @@
 
 ///
 #define BX_CLASS_NO_DEFAULT_CTOR(_class) \
-	private: _class()
+	_class() = delete
 
 #define BX_CLASS_NO_COPY(_class) \
-	private: _class(const _class& _rhs)
+	_class(const _class& _rhs) = delete
 
-#define BX_CLASS_NO_ASSIGNMENT(_class) \
-	private: _class& operator=(const _class& _rhs)
+#define BX_CLASS_NO_COPY_ASSIGNMENT(_class) \
+	_class& operator=(const _class& _rhs) = delete
 
 #define BX_CLASS_ALLOCATOR(_class)              \
 	public: void* operator new(size_t _size);   \

+ 4 - 2
include/bx/mpscqueue.h

@@ -17,8 +17,9 @@ namespace bx
 	class MpScUnboundedQueueT
 	{
 		BX_CLASS(MpScUnboundedQueueT
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -47,8 +48,9 @@ namespace bx
 	class MpScUnboundedBlockingQueue
 	{
 		BX_CLASS(MpScUnboundedBlockingQueue
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:

+ 2 - 2
include/bx/mutex.h

@@ -15,7 +15,7 @@ namespace bx
 	{
 		BX_CLASS(Mutex
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -41,7 +41,7 @@ namespace bx
 		BX_CLASS(MutexScope
 			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:

+ 6 - 4
include/bx/ringbuffer.h

@@ -16,8 +16,9 @@ namespace bx
 	class RingBufferControl
 	{
 		BX_CLASS(RingBufferControl
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -55,8 +56,9 @@ namespace bx
 	class SpScRingBufferControl
 	{
 		BX_CLASS(SpScRingBufferControl
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -97,7 +99,7 @@ namespace bx
 		BX_CLASS(ReadRingBufferT
 			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -140,7 +142,7 @@ namespace bx
 		BX_CLASS(WriteRingBufferT
 			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:

+ 1 - 1
include/bx/semaphore.h

@@ -15,7 +15,7 @@ namespace bx
 	{
 		BX_CLASS(Semaphore
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:

+ 8 - 4
include/bx/spscqueue.h

@@ -16,8 +16,9 @@ namespace bx
 	class SpScUnboundedQueue
 	{
 		BX_CLASS(SpScUnboundedQueue
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -57,8 +58,9 @@ namespace bx
 	class SpScUnboundedQueueT
 	{
 		BX_CLASS(SpScUnboundedQueueT
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -86,8 +88,9 @@ namespace bx
 	class SpScBlockingUnboundedQueue
 	{
 		BX_CLASS(SpScBlockingUnboundedQueue
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:
@@ -116,8 +119,9 @@ namespace bx
 	class SpScBlockingUnboundedQueueT
 	{
 		BX_CLASS(SpScBlockingUnboundedQueueT
+			, NO_DEFAULT_CTOR
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:

+ 1 - 1
include/bx/thread.h

@@ -21,7 +21,7 @@ namespace bx
 	{
 		BX_CLASS(Thread
 			, NO_COPY
-			, NO_ASSIGNMENT
+			, NO_COPY_ASSIGNMENT
 			);
 
 	public:

+ 1 - 1
src/thread.cpp

@@ -21,7 +21,7 @@
 	|| BX_PLATFORM_IOS     \
 	|| BX_PLATFORM_OSX     \
 	|| BX_PLATFORM_PS4     \
-	|| BX_PLATFORM_RPI	   \
+	|| BX_PLATFORM_RPI     \
 	|| BX_PLATFORM_NX
 #	include <pthread.h>
 #	if BX_PLATFORM_BSD