Browse Source

Use deletion instead of unimplemented constructors

master
Robin Krahl 1 year ago
parent
commit
74aec22eb5
1 changed files with 7 additions and 7 deletions
  1. 7
    7
      include/sqlitepp/sqlitepp.h

+ 7
- 7
include/sqlitepp/sqlitepp.h View File

@@ -122,19 +122,19 @@ extern const std::string VERSION;
122 122
 
123 123
 /// \brief A class that forbids copying and assignments for all subclasses.
124 124
 ///
125
-/// This class defines a private, unimplemented copy constructor and assignment
126
-/// method so that copies and assignments fail at compile-time. This class is
127
-/// inspired by Scott Meyers, <em>Effective C++</em>, 3rd Edition, Item 6.
125
+/// This class deletes the copy constructor and the assignment operator so
126
+/// that copies and assignments fail at compile-time. This class is inspired by
127
+/// Scott Meyers, <em>Effective C++</em>, 3rd Edition, Item 6.
128 128
 class Uncopyable {
129
+ public:
130
+  Uncopyable(const Uncopyable&) = delete;
131
+  Uncopyable& operator=(const Uncopyable&) = delete;
132
+
129 133
  protected:
130 134
   Uncopyable() = default;
131 135
   ~Uncopyable() = default;
132 136
   Uncopyable(Uncopyable&&) = default;
133 137
   Uncopyable& operator=(Uncopyable&&) = default;
134
-
135
- private:
136
-  Uncopyable(const Uncopyable&);
137
-  Uncopyable& operator=(const Uncopyable&);
138 138
 };
139 139
 
140 140
 /// \brief An element that has the two states *open* and *closed*.

Loading…
Cancel
Save