All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
lar::PolymorphicUncopiableClass Struct Reference

A polymorphic empty class that can't be copied (moving is allowed). More...

#include <UncopiableAndUnmovableClass.h>

Inheritance diagram for lar::PolymorphicUncopiableClass:
lar::PolymorphicClass lar::PolymorphicUncopiableAndUnmovableClass

Public Member Functions

 PolymorphicUncopiableClass ()=default
 
 PolymorphicUncopiableClass (PolymorphicUncopiableClass const &)=delete
 
 PolymorphicUncopiableClass (PolymorphicUncopiableClass &&)=default
 
PolymorphicUncopiableClassoperator= (PolymorphicUncopiableClass const &)=delete
 
PolymorphicUncopiableClassoperator= (PolymorphicUncopiableClass &&)=default
 
- Public Member Functions inherited from lar::PolymorphicClass
 PolymorphicClass ()=default
 
virtual ~PolymorphicClass ()=default
 

Detailed Description

A polymorphic empty class that can't be copied (moving is allowed).

See Also
PolymorphicClass, PolymorphicUnmovableClass, PolymorphicUncopiableAndUnmovableClass

A class derived from this one can still be copied with an explicit effort. For example, to enable copy construction:

struct CopiableClass: protected PolymorphicUncopiableClass {
CopiableClass(CopiableClass const& from)
{
// ...
}
};

the default constructor of the base class can be called explicitly instead of the copy constructor. To provide an assignment operation,

struct CopyAssignableClass: protected PolymorphicUncopiableClass {
CopyAssignableClass& operator= (CopyAssignableClass const& from)
{
// ...
return *this;
}
};

Definition at line 237 of file UncopiableAndUnmovableClass.h.

Constructor & Destructor Documentation

lar::PolymorphicUncopiableClass::PolymorphicUncopiableClass ( )
default
lar::PolymorphicUncopiableClass::PolymorphicUncopiableClass ( PolymorphicUncopiableClass const &  )
delete
lar::PolymorphicUncopiableClass::PolymorphicUncopiableClass ( PolymorphicUncopiableClass &&  )
default

Member Function Documentation

PolymorphicUncopiableClass& lar::PolymorphicUncopiableClass::operator= ( PolymorphicUncopiableClass const &  )
delete
PolymorphicUncopiableClass& lar::PolymorphicUncopiableClass::operator= ( PolymorphicUncopiableClass &&  )
default

The documentation for this struct was generated from the following file: