1

Add macros to easily delete copy/move constructors

This commit is contained in:
2022-12-08 19:10:12 +01:00
parent 4b228ce301
commit ad601e1332

View File

@ -0,0 +1,18 @@
#ifndef CHURLOS_RESTRICTEDCONSTRUCTORS_H
#define CHURLOS_RESTRICTEDCONSTRUCTORS_H
// Some convenience macros to easily delete copy/move constructors
#define MakeDefault(T) \
T() = default; \
~T() = default;
#define MakeUncopyable(T) \
T(const T &copy) = delete; \
T &operator=(const T &copy) = delete;
#define MakeUnmovable(T) \
T(T &&move) = delete;\
T &operator=(T &&move) = delete;
#endif //CHURLOS_RESTRICTEDCONSTRUCTORS_H