LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar::UncopiableAndUnmovableClass Struct Reference

An empty class that can't be copied nor moved. More...

#include "UncopiableAndUnmovableClass.h"

Inheritance diagram for lar::UncopiableAndUnmovableClass:
lar::example::ShowerCalibrationGalore lar::example::ShowerCalibrationGaloreFromPID lar::example::ShowerCalibrationGaloreScale

Public Member Functions

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

Detailed Description

An empty class that can't be copied nor moved.


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

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

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

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

Definition at line 43 of file UncopiableAndUnmovableClass.h.

Constructor & Destructor Documentation

lar::UncopiableAndUnmovableClass::UncopiableAndUnmovableClass ( )
default

Default constructor.

lar::UncopiableAndUnmovableClass::UncopiableAndUnmovableClass ( UncopiableAndUnmovableClass const &  )
delete

Deleted copy and move constructors and assignments.

lar::UncopiableAndUnmovableClass::UncopiableAndUnmovableClass ( UncopiableAndUnmovableClass &&  )
delete

Deleted copy and move constructors and assignments.

lar::UncopiableAndUnmovableClass::~UncopiableAndUnmovableClass ( )
default

Default destructor.

Member Function Documentation

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

Deleted copy and move constructors and assignments.

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

Deleted copy and move constructors and assignments.


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