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;

/// \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*.

Loading…
Cancel
Save