LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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
 

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 229 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: