LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar::UncopiableClass Struct Reference

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

#include "UncopiableAndUnmovableClass.h"

Inheritance diagram for lar::UncopiableClass:
lar::UncopiableAndUnmovableClass

Public Member Functions

 UncopiableClass ()=default
 Default constructor. More...
 
 ~UncopiableClass ()=default
 Default destructor. More...
 
 UncopiableClass (UncopiableClass const &)=delete
 Deleted copy and move constructors and assignments. More...
 
 UncopiableClass (UncopiableClass &&)=default
 Deleted copy and move constructors and assignments. More...
 
UncopiableClassoperator= (UncopiableClass const &)=delete
 Deleted copy and move constructors and assignments. More...
 
UncopiableClassoperator= (UncopiableClass &&)=default
 Deleted copy and move constructors and assignments. More...
 

Detailed Description

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


See also
UnmovableClass, UncopiableAndUnmovableClass

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

struct CopiableClass: protected UncopiableAndUnmovableClass {
CopiableClass(CopiableClass const& from)
: UncopiableClass() // , ...
{
// ...
}
};

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

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

Definition at line 71 of file UncopiableAndUnmovableClass.h.

Constructor & Destructor Documentation

lar::UncopiableClass::UncopiableClass ( )
default

Default constructor.

lar::UncopiableClass::UncopiableClass ( UncopiableClass const &  )
delete

Deleted copy and move constructors and assignments.

lar::UncopiableClass::UncopiableClass ( UncopiableClass &&  )
default

Deleted copy and move constructors and assignments.

lar::UncopiableClass::~UncopiableClass ( )
default

Default destructor.

Member Function Documentation

UncopiableClass& lar::UncopiableClass::operator= ( UncopiableClass const &  )
delete

Deleted copy and move constructors and assignments.

UncopiableClass& lar::UncopiableClass::operator= ( UncopiableClass &&  )
default

Deleted copy and move constructors and assignments.


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