ClassMacros.h 462 B

1234567891011121314
  1. #pragma once
  2. #if defined UNCOPYABLE_CLASS
  3. #undef UNCOPYABLE_CLASS
  4. #endif
  5. #if __cplusplus >= 201103L || (defined _MSC_VER && __cplusplus >= 199711L)
  6. #define UNCOPYABLE_CLASS(CLASS_NAME) \
  7. CLASS_NAME(CLASS_NAME const &) = delete; \
  8. CLASS_NAME &operator=(CLASS_NAME const &) = delete;
  9. #else
  10. #define UNCOPYABLE_CLASS(CLASS_NAME) \
  11. private: \
  12. CLASS_NAME(CLASS_NAME const &); \
  13. CLASS_NAME &operator=(CLASS_NAME const &)
  14. #endif