Use CRYPTOPP_CXX11_DELETED_FUNCTIONS in NotCopyable

This commit is contained in:
Jeffrey Walton 2019-07-01 13:27:51 -04:00
parent 36e8dfeca8
commit c3d4e79a09
No known key found for this signature in database
GPG Key ID: B36AB348921B1838

13
misc.h
View File

@ -222,16 +222,21 @@ protected:
/// \brief Ensures an object is not copyable
/// \details NotCopyable ensures an object is not copyable by making the
/// copy constructor and assignment operator private. Deleters are not
/// used under C++11.
/// copy constructor and assignment operator private. Deleters are used
/// under C++11.
/// \sa Clonable class
class NotCopyable
{
public:
NotCopyable() {}
#if CRYPTOPP_CXX11_DELETED_FUNCTIONS
NotCopyable(const NotCopyable &) = delete;
void operator=(const NotCopyable &) = delete;
#else
private:
NotCopyable(const NotCopyable &);
void operator=(const NotCopyable &);
NotCopyable(const NotCopyable &);
void operator=(const NotCopyable &);
#endif
};
/// \brief An object factory function