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

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
 Default copy constructor and assignment. More...
 
 UnmovableClass (UnmovableClass &&)=delete
 Deleted move constructor and assignment. More...
 
UnmovableClassoperator= (UnmovableClass &&)=delete
 Deleted move constructor and assignment. More...
 

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 118 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

Default copy constructor and assignment.

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

Deleted move constructor and assignment.


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