Use CRYPTOPP_CXX11_DELETED_FUNCTIONS in NotCopyable
parent
36e8dfeca8
commit
c3d4e79a09
13
misc.h
13
misc.h
|
|
@ -222,16 +222,21 @@ protected:
|
||||||
|
|
||||||
/// \brief Ensures an object is not copyable
|
/// \brief Ensures an object is not copyable
|
||||||
/// \details NotCopyable ensures an object is not copyable by making the
|
/// \details NotCopyable ensures an object is not copyable by making the
|
||||||
/// copy constructor and assignment operator private. Deleters are not
|
/// copy constructor and assignment operator private. Deleters are used
|
||||||
/// used under C++11.
|
/// under C++11.
|
||||||
/// \sa Clonable class
|
/// \sa Clonable class
|
||||||
class NotCopyable
|
class NotCopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NotCopyable() {}
|
NotCopyable() {}
|
||||||
|
#if CRYPTOPP_CXX11_DELETED_FUNCTIONS
|
||||||
|
NotCopyable(const NotCopyable &) = delete;
|
||||||
|
void operator=(const NotCopyable &) = delete;
|
||||||
|
#else
|
||||||
private:
|
private:
|
||||||
NotCopyable(const NotCopyable &);
|
NotCopyable(const NotCopyable &);
|
||||||
void operator=(const NotCopyable &);
|
void operator=(const NotCopyable &);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/// \brief An object factory function
|
/// \brief An object factory function
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue