diff options
author | Robin Krahl <me@robin-krahl.de> | 2018-02-15 23:01:49 +0100 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2018-02-15 23:04:06 +0100 |
commit | 74aec22eb5b02b7878d15627eef4d5a2dcce6b06 (patch) | |
tree | 70d7b6cc89fcce5cf5267401b71cb999f0789f65 /include | |
parent | 8338799d28a8177921cee2da5e19cd4f97eee68e (diff) | |
download | sqlitepp-74aec22eb5b02b7878d15627eef4d5a2dcce6b06.tar.gz sqlitepp-74aec22eb5b02b7878d15627eef4d5a2dcce6b06.tar.bz2 |
Use deletion instead of unimplemented constructors
Diffstat (limited to 'include')
-rw-r--r-- | include/sqlitepp/sqlitepp.h | 14 |
1 files changed, 7 insertions, 7 deletions
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, <em>Effective C++</em>, 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, <em>Effective C++</em>, 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*. |