diff options
author | Jeffrey Walton <noloader@gmail.com> | 2019-07-01 13:27:51 -0400 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2019-07-01 13:27:51 -0400 |
commit | c3d4e79a0983c1b5ccf885d39edd44cebd51c07b (patch) | |
tree | 20822a7d539bd5094a78f46123f523b70316c103 /misc.h | |
parent | 36e8dfeca83efd1d63b11664545a3bb396a051b8 (diff) | |
download | cryptopp-git-c3d4e79a0983c1b5ccf885d39edd44cebd51c07b.tar.gz |
Use CRYPTOPP_CXX11_DELETED_FUNCTIONS in NotCopyable
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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
|