reimplement Q_DISABLE_COPY_MOVE for full compatibility with versions < 5.13
I was under the impression Q_DISABLE_COPY_MOVE was a much older function than it is. Since we historically target 5.6 and these functions are small convenience functions, I just implemented them in the actual codebase.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#ifndef CONSTRUCTORS_H
|
||||
#define CONSTRUCTORS_H
|
||||
|
||||
/**
|
||||
* Copy/move deleters. Similar to Q_DISABLE_COPY_MOVE, et al. but those functions
|
||||
*/
|
||||
|
||||
#define DISABLE_COPY(Class) \
|
||||
Class(const Class &) = delete;\
|
||||
Class &operator=(const Class &) = delete;
|
||||
|
||||
#define DISABLE_MOVE(Class) \
|
||||
Class(Class &&) = delete; \
|
||||
Class &operator=(Class &&) = delete;
|
||||
|
||||
#define DISABLE_COPY_MOVE(Class) \
|
||||
DISABLE_COPY(Class) \
|
||||
DISABLE_MOVE(Class)
|
||||
|
||||
#endif // CONSTRUCTORS_H
|
||||
Reference in New Issue
Block a user