PStack  2.0
Stack trace printer for MSVC and GCC binaries
psystem::not_copyable Class Reference

Remove the ability to copy or reassign from derived classes. More...

#include <not_copyable.hpp>

Inheritance diagram for psystem::not_copyable:

Protected Member Functions

 not_copyable (not_copyable const &)=delete
 Delete the copy constructor.
 
not_copyableoperator= (not_copyable const &)=delete
 Delete the assignment operator.
 
constexpr not_copyable () noexcept
 A simple CTOR suitable for noexcept and constexpr uses.
 
 ~not_copyable () noexcept
 A simple CTOR suitable for noexcept uses.
 

Detailed Description

Remove the ability to copy or reassign from derived classes.

When a class should disallow both copying and reassigning, it should derive from psystem::not_copyable (to disallow only reassignment, see psystem::not_assignable). This mechanism provides a simple and readable way to avoid boiler-plate method deletion, and to signal intent in the class declaration. This has no run-time overhead.

Note
This can be cirucumvented, by overloading operator=() or providing a copy constructor again.
Author
Matt Bisson
Date
5 August, 2014
Since
PSystem 2.0
Version
PSystem 2.0

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