ACE 8.0.3
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
ACE_Copy_Disabled Class Reference

Helper class to disable copy construction and assignment. More...

#include <Copy_Disabled.h>

Public Member Functions

 ACE_Copy_Disabled ()=default
 Default constructor.
 

Private Member Functions

 ACE_Copy_Disabled (const ACE_Copy_Disabled &)=delete
 
 ACE_Copy_Disabled (ACE_Copy_Disabled &&)=delete
 
ACE_Copy_Disabledoperator= (const ACE_Copy_Disabled &)=delete
 
ACE_Copy_Disabledoperator= (ACE_Copy_Disabled &&)=delete
 

Detailed Description

Helper class to disable copy construction and assignment.

Classes used to control OS and other resources are not "canonical", i.e. they have their copy constructor and assignment operators disabled. This is often done by making the copy constructor and assignment operators private, effectively disallowing copying by clients of the class (including derived classes). If the copy constructor and assignment operators are left unimplemented then the class itself cannot make any copies of its instances, because it would result in link errors.

To use this class simply use private inheritance:

class Foo : private ACE_Copy_Disabled { // code here };

Deprecated
This class is deprecated. Instead of using inheritance, directly delete copy operations in your class:

class Foo { public: Foo(const Foo&) = delete; Foo(Foo&&) = delete; Foo& operator=(const Foo&) = delete; Foo& operator=(Foo&&) = delete; };

Constructor & Destructor Documentation

◆ ACE_Copy_Disabled() [1/3]

ACE_Copy_Disabled::ACE_Copy_Disabled ( )
default

Default constructor.

◆ ACE_Copy_Disabled() [2/3]

ACE_Copy_Disabled::ACE_Copy_Disabled ( const ACE_Copy_Disabled & )
privatedelete

◆ ACE_Copy_Disabled() [3/3]

ACE_Copy_Disabled::ACE_Copy_Disabled ( ACE_Copy_Disabled && )
privatedelete

Member Function Documentation

◆ operator=() [1/2]

ACE_Copy_Disabled & ACE_Copy_Disabled::operator= ( ACE_Copy_Disabled && )
privatedelete

◆ operator=() [2/2]

ACE_Copy_Disabled & ACE_Copy_Disabled::operator= ( const ACE_Copy_Disabled & )
privatedelete

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