Public Member Functions | List of all members
lar::UnmovableClass Struct Reference

An empty class that can't be moved (copy is allowed). More...

#include <UncopiableAndUnmovableClass.h>

Inheritance diagram for lar::UnmovableClass:
lar::UncopiableAndUnmovableClass lar::example::ShowerCalibrationGalore lariov::ChannelStatusProvider lariov::DetPedestalProvider lariov::ElectronicsCalibProvider lariov::ElectronLifetimeProvider lariov::PmtGainProvider MyOtherProvider MyProvider svc::ProviderA svc::ProviderB svc::ProviderD YetAnotherProvider

Public Member Functions

 UnmovableClass ()=default
 Default constructor. More...
 
 ~UnmovableClass ()=default
 Default destructor. More...
 
 UnmovableClass (UnmovableClass const &)=default
 Default copy constructor and assignment. More...
 
UnmovableClassoperator= (UnmovableClass const &)=default
 
 UnmovableClass (UnmovableClass &&)=delete
 Deleted move constructor and assignment. More...
 
UnmovableClassoperator= (UnmovableClass &&)=delete
 

Detailed Description

An empty class that can't be moved (copy is allowed).


See also
UncopiableClass, UncopiableAndUnmovableClass

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

struct MoveableClass: protected UnmovableClass {
MoveableClass(MoveableClass&& from)
: UnmovableClass() // , ...
{
// ...
}
};

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

struct MoveAssignableClass: protected UnmovableClass {
MoveAssignableClass& operator= (MoveAssignableClass&& from)
{
// ...
return *this;
}
};

Definition at line 120 of file UncopiableAndUnmovableClass.h.

Constructor & Destructor Documentation

lar::UnmovableClass::UnmovableClass ( )
default

Default constructor.

lar::UnmovableClass::UnmovableClass ( UnmovableClass const &  )
default

Default copy constructor and assignment.

lar::UnmovableClass::UnmovableClass ( UnmovableClass &&  )
delete

Deleted move constructor and assignment.

lar::UnmovableClass::~UnmovableClass ( )
default

Default destructor.

Member Function Documentation

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

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