From 74aec22eb5b02b7878d15627eef4d5a2dcce6b06 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Thu, 15 Feb 2018 23:01:49 +0100 Subject: Use deletion instead of unimplemented constructors --- include/sqlitepp/sqlitepp.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/sqlitepp/sqlitepp.h b/include/sqlitepp/sqlitepp.h index efee8b2..a2e419c 100644 --- a/include/sqlitepp/sqlitepp.h +++ b/include/sqlitepp/sqlitepp.h @@ -122,19 +122,19 @@ extern const std::string VERSION; /// \brief A class that forbids copying and assignments for all subclasses. /// -/// This class defines a private, unimplemented copy constructor and assignment -/// method so that copies and assignments fail at compile-time. This class is -/// inspired by Scott Meyers, Effective C++, 3rd Edition, Item 6. +/// This class deletes the copy constructor and the assignment operator so +/// that copies and assignments fail at compile-time. This class is inspired by +/// Scott Meyers, Effective C++, 3rd Edition, Item 6. class Uncopyable { + public: + Uncopyable(const Uncopyable&) = delete; + Uncopyable& operator=(const Uncopyable&) = delete; + protected: Uncopyable() = default; ~Uncopyable() = default; Uncopyable(Uncopyable&&) = default; Uncopyable& operator=(Uncopyable&&) = default; - - private: - Uncopyable(const Uncopyable&); - Uncopyable& operator=(const Uncopyable&); }; /// \brief An element that has the two states *open* and *closed*. -- cgit v1.2.3