Add missing special member functions

This commit is contained in:
Ben RUBSON 2018-01-23 08:45:30 +01:00 committed by GitHub
parent 2af7c56254
commit db76b3b856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 4 deletions

View File

@ -142,10 +142,14 @@ class RenameOp {
last = renameList->begin(); last = renameList->begin();
} }
RenameOp(const RenameOp &src) = default; // destructor
~RenameOp(); ~RenameOp();
RenameOp(const RenameOp &src) = delete; // copy contructor
RenameOp(RenameOp&& other) = delete; // move constructor
RenameOp& operator=(const RenameOp& other) = delete; // copy assignment
RenameOp& operator=(RenameOp&& other) = delete; // move assignment
explicit operator bool() const { return renameList != nullptr; } explicit operator bool() const { return renameList != nullptr; }
bool apply(); bool apply();

View File

@ -50,16 +50,32 @@ static bool NullCipher_registered = Cipher::Register(
class NullKey : public AbstractCipherKey { class NullKey : public AbstractCipherKey {
public: public:
NullKey() = default; NullKey() = default;
// destructor
~NullKey() override = default; ~NullKey() override = default;
NullKey(const NullKey &src) = delete; // copy constructor
NullKey(NullKey&& other) = delete; // move constructor
NullKey& operator=(const NullKey& other) = delete; // copy assignment
NullKey& operator=(NullKey&& other) = delete; // move assignment
}; };
class NullDestructor { class NullDestructor {
public: public:
NullDestructor() = default; NullDestructor() = default;
NullDestructor(const NullDestructor &) = default;
// destructor
~NullDestructor() = default; ~NullDestructor() = default;
NullDestructor &operator=(const NullDestructor &) = default; // copy contructor
NullDestructor(const NullDestructor &) = default;
// move constructor
NullDestructor(NullDestructor &&) = default;
NullDestructor &operator=(const NullDestructor &) = delete; // copy assignment
NullDestructor& operator=(NullDestructor&& other) = delete; // move assignment
void operator()(NullKey *&) {} void operator()(NullKey *&) {}
}; };
std::shared_ptr<AbstractCipherKey> gNullKey(new NullKey(), NullDestructor()); std::shared_ptr<AbstractCipherKey> gNullKey(new NullKey(), NullDestructor());

View File

@ -293,7 +293,14 @@ class SSLKey : public AbstractCipherKey {
HMAC_CTX *mac_ctx; HMAC_CTX *mac_ctx;
SSLKey(int keySize, int ivLength); SSLKey(int keySize, int ivLength);
// destructor
~SSLKey() override; ~SSLKey() override;
SSLKey(const SSLKey &src) = delete; // copy constructor
SSLKey(SSLKey&& other) = delete; // move constructor
SSLKey& operator=(const SSLKey& other) = delete; // copy assignment
SSLKey& operator=(SSLKey&& other) = delete; // move assignment
}; };
SSLKey::SSLKey(int keySize_, int ivLength_) { SSLKey::SSLKey(int keySize_, int ivLength_) {

View File

@ -169,8 +169,14 @@ class XmlNode : virtual public XmlValue {
explicit XmlNode(const tinyxml2::XMLElement *element_) explicit XmlNode(const tinyxml2::XMLElement *element_)
: XmlValue(safeValueForNode(element_)), element(element_) {} : XmlValue(safeValueForNode(element_)), element(element_) {}
// destructor
~XmlNode() override = default; ~XmlNode() override = default;
XmlNode(const XmlNode &src) = delete; // copy constructor
XmlNode(XmlNode&& other) = delete; // move constructor
XmlNode& operator=(const XmlNode& other) = delete; // copy assignment
XmlNode& operator=(XmlNode&& other) = delete; // move assignment
XmlValuePtr find(const char *name) const override { XmlValuePtr find(const char *name) const override {
if (name[0] == '@') { if (name[0] == '@') {
const char *value = element->Attribute(name + 1); const char *value = element->Attribute(name + 1);