From c3d4e79a0983c1b5ccf885d39edd44cebd51c07b Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 1 Jul 2019 13:27:51 -0400 Subject: [PATCH] Use CRYPTOPP_CXX11_DELETED_FUNCTIONS in NotCopyable --- misc.h | 13 +++++++++---- 1 file 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