summaryrefslogtreecommitdiff
path: root/misc.h
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-07-01 13:27:51 -0400
committerJeffrey Walton <noloader@gmail.com>2019-07-01 13:27:51 -0400
commitc3d4e79a0983c1b5ccf885d39edd44cebd51c07b (patch)
tree20822a7d539bd5094a78f46123f523b70316c103 /misc.h
parent36e8dfeca83efd1d63b11664545a3bb396a051b8 (diff)
downloadcryptopp-git-c3d4e79a0983c1b5ccf885d39edd44cebd51c07b.tar.gz
Use CRYPTOPP_CXX11_DELETED_FUNCTIONS in NotCopyable
Diffstat (limited to 'misc.h')
-rw-r--r--misc.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/misc.h b/misc.h
index 1560eefe..ce6fff28 100644
--- a/misc.h
+++ b/misc.h
@@ -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