An empty class that can't be copied nor moved. More...
#include <UncopiableAndUnmovableClass.h>
Public Member Functions | |
UncopiableAndUnmovableClass ()=default | |
Default constructor. More... | |
~UncopiableAndUnmovableClass ()=default | |
Default destructor. More... | |
UncopiableAndUnmovableClass (UncopiableAndUnmovableClass const &)=delete | |
Deleted copy and move constructors and assignments. More... | |
UncopiableAndUnmovableClass (UncopiableAndUnmovableClass &&)=delete | |
UncopiableAndUnmovableClass & | operator= (UncopiableAndUnmovableClass const &)=delete |
UncopiableAndUnmovableClass & | operator= (UncopiableAndUnmovableClass &&)=delete |
An empty class that can't be copied nor moved.
A class derived from this one can still be copied (or moved) with an explicit effort. For example, to enable copy construction:
struct CopiableClass: protected UncopiableAndUnmovableClass { CopiableClass(CopiableClass const& from) : UncopiableAndUnmovableClass() // , ... { // ... } };
the default constructor of the base class can be called explicitly instead of the copy constructor. To provide an assignment operation,
struct MoveAssignableClass: protected UncopiableAndUnmovableClass { MoveAssignableClass& operator= (MoveAssignableClass&& from) { // ... return *this; } };
Definition at line 43 of file UncopiableAndUnmovableClass.h.
|
default |
Default constructor.
|
delete |
Deleted copy and move constructors and assignments.
|
delete |
|
default |
Default destructor.
|
delete |
|
delete |