diff --git a/include/yaml-cpp/eventhandler.h b/include/yaml-cpp/eventhandler.h index 29718ff..7242fe1 100644 --- a/include/yaml-cpp/eventhandler.h +++ b/include/yaml-cpp/eventhandler.h @@ -17,7 +17,7 @@ struct Mark; class EventHandler { public: - virtual ~EventHandler() {} + virtual ~EventHandler() = default; virtual void OnDocumentStart(const Mark& mark) = 0; virtual void OnDocumentEnd() = 0; diff --git a/include/yaml-cpp/exceptions.h b/include/yaml-cpp/exceptions.h index eef2283..38333c2 100644 --- a/include/yaml-cpp/exceptions.h +++ b/include/yaml-cpp/exceptions.h @@ -210,7 +210,7 @@ class YAML_CPP_API TypedKeyNotFound : public KeyNotFound { public: TypedKeyNotFound(const Mark& mark_, const T& key_) : KeyNotFound(mark_, key_), key(key_) {} - virtual ~TypedKeyNotFound() YAML_CPP_NOEXCEPT {} + virtual ~TypedKeyNotFound() YAML_CPP_NOEXCEPT = default; T key; }; diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h index 7a3deac..e59505d 100644 --- a/include/yaml-cpp/node/impl.h +++ b/include/yaml-cpp/node/impl.h @@ -42,11 +42,7 @@ inline Node::Node(const detail::iterator_value& rhs) m_pMemory(rhs.m_pMemory), m_pNode(rhs.m_pNode) {} -inline Node::Node(const Node& rhs) - : m_isValid(rhs.m_isValid), - m_invalidKey(rhs.m_invalidKey), - m_pMemory(rhs.m_pMemory), - m_pNode(rhs.m_pNode) {} +inline Node::Node(const Node& rhs) = default; inline Node::Node(Zombie) : m_isValid(false), m_invalidKey{}, m_pMemory{}, m_pNode(nullptr) {} @@ -57,7 +53,7 @@ inline Node::Node(Zombie, const std::string& key) inline Node::Node(detail::node& node, detail::shared_memory_holder pMemory) : m_isValid(true), m_invalidKey{}, m_pMemory(pMemory), m_pNode(&node) {} -inline Node::~Node() {} +inline Node::~Node() = default; inline void Node::EnsureNodeExists() const { if (!m_isValid) diff --git a/include/yaml-cpp/node/iterator.h b/include/yaml-cpp/node/iterator.h index 366a9c8..b447238 100644 --- a/include/yaml-cpp/node/iterator.h +++ b/include/yaml-cpp/node/iterator.h @@ -18,7 +18,7 @@ namespace YAML { namespace detail { struct iterator_value : public Node, std::pair { - iterator_value() {} + iterator_value() = default; explicit iterator_value(const Node& rhs) : Node(rhs), std::pair(Node(Node::ZombieNode), Node(Node::ZombieNode)) {} diff --git a/src/emitter.cpp b/src/emitter.cpp index 016beb1..06f633c 100644 --- a/src/emitter.cpp +++ b/src/emitter.cpp @@ -16,7 +16,7 @@ Emitter::Emitter() : m_pState(new EmitterState), m_stream{} {} Emitter::Emitter(std::ostream& stream) : m_pState(new EmitterState), m_stream(stream) {} -Emitter::~Emitter() {} +Emitter::~Emitter() = default; const char* Emitter::c_str() const { return m_stream.str(); } diff --git a/src/emitterstate.cpp b/src/emitterstate.cpp index 890b4f0..5c76226 100644 --- a/src/emitterstate.cpp +++ b/src/emitterstate.cpp @@ -32,7 +32,7 @@ EmitterState::EmitterState() m_hasNonContent(false), m_docCount(0) {} -EmitterState::~EmitterState() {} +EmitterState::~EmitterState() = default; // SetLocalValue // . We blindly tries to set all possible formatters to this value diff --git a/src/exceptions.cpp b/src/exceptions.cpp index 841549e..dd833bb 100644 --- a/src/exceptions.cpp +++ b/src/exceptions.cpp @@ -11,19 +11,19 @@ namespace YAML { // These destructors are defined out-of-line so the vtable is only emitted once. -Exception::~Exception() YAML_CPP_NOEXCEPT {} -ParserException::~ParserException() YAML_CPP_NOEXCEPT {} -RepresentationException::~RepresentationException() YAML_CPP_NOEXCEPT {} -InvalidScalar::~InvalidScalar() YAML_CPP_NOEXCEPT {} -KeyNotFound::~KeyNotFound() YAML_CPP_NOEXCEPT {} -InvalidNode::~InvalidNode() YAML_CPP_NOEXCEPT {} -BadConversion::~BadConversion() YAML_CPP_NOEXCEPT {} -BadDereference::~BadDereference() YAML_CPP_NOEXCEPT {} -BadSubscript::~BadSubscript() YAML_CPP_NOEXCEPT {} -BadPushback::~BadPushback() YAML_CPP_NOEXCEPT {} -BadInsert::~BadInsert() YAML_CPP_NOEXCEPT {} -EmitterException::~EmitterException() YAML_CPP_NOEXCEPT {} -BadFile::~BadFile() YAML_CPP_NOEXCEPT {} +Exception::~Exception() YAML_CPP_NOEXCEPT = default; +ParserException::~ParserException() YAML_CPP_NOEXCEPT = default; +RepresentationException::~RepresentationException() YAML_CPP_NOEXCEPT = default; +InvalidScalar::~InvalidScalar() YAML_CPP_NOEXCEPT = default; +KeyNotFound::~KeyNotFound() YAML_CPP_NOEXCEPT = default; +InvalidNode::~InvalidNode() YAML_CPP_NOEXCEPT = default; +BadConversion::~BadConversion() YAML_CPP_NOEXCEPT = default; +BadDereference::~BadDereference() YAML_CPP_NOEXCEPT = default; +BadSubscript::~BadSubscript() YAML_CPP_NOEXCEPT = default; +BadPushback::~BadPushback() YAML_CPP_NOEXCEPT = default; +BadInsert::~BadInsert() YAML_CPP_NOEXCEPT = default; +EmitterException::~EmitterException() YAML_CPP_NOEXCEPT = default; +BadFile::~BadFile() YAML_CPP_NOEXCEPT = default; } #undef YAML_CPP_NOEXCEPT diff --git a/src/nodebuilder.cpp b/src/nodebuilder.cpp index 171afd8..8dac0c5 100644 --- a/src/nodebuilder.cpp +++ b/src/nodebuilder.cpp @@ -19,7 +19,7 @@ NodeBuilder::NodeBuilder() m_anchors.push_back(nullptr); // since the anchors start at 1 } -NodeBuilder::~NodeBuilder() {} +NodeBuilder::~NodeBuilder() = default; Node NodeBuilder::Root() { if (!m_pRoot) diff --git a/src/ostream_wrapper.cpp b/src/ostream_wrapper.cpp index 5fa5858..2127dfe 100644 --- a/src/ostream_wrapper.cpp +++ b/src/ostream_wrapper.cpp @@ -21,7 +21,7 @@ ostream_wrapper::ostream_wrapper(std::ostream& stream) m_col(0), m_comment(false) {} -ostream_wrapper::~ostream_wrapper() {} +ostream_wrapper::~ostream_wrapper() = default; void ostream_wrapper::write(const std::string& str) { if (m_pStream) { diff --git a/src/parser.cpp b/src/parser.cpp index 7bc0c78..81eac97 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -15,7 +15,7 @@ Parser::Parser() : m_pScanner{}, m_pDirectives{} {} Parser::Parser(std::istream& in) : Parser() { Load(in); } -Parser::~Parser() {} +Parser::~Parser() = default; Parser::operator bool() const { return m_pScanner.get() && !m_pScanner->empty(); diff --git a/src/regex_yaml.h b/src/regex_yaml.h index 3a347bb..c70ab60 100644 --- a/src/regex_yaml.h +++ b/src/regex_yaml.h @@ -34,7 +34,7 @@ class YAML_CPP_API RegEx { explicit RegEx(char ch); RegEx(char a, char z); RegEx(const std::string& str, REGEX_OP op = REGEX_SEQ); - ~RegEx() {} + ~RegEx() = default; friend YAML_CPP_API RegEx operator!(const RegEx& ex); friend YAML_CPP_API RegEx operator|(const RegEx& ex1, const RegEx& ex2); diff --git a/src/scanner.cpp b/src/scanner.cpp index ac84892..3a466b3 100644 --- a/src/scanner.cpp +++ b/src/scanner.cpp @@ -19,7 +19,7 @@ Scanner::Scanner(std::istream& in) m_indentRefs{}, m_flows{} {} -Scanner::~Scanner() {} +Scanner::~Scanner() = default; bool Scanner::empty() { EnsureTokensInQueue(); diff --git a/src/setting.h b/src/setting.h index 280d1e7..30bf831 100644 --- a/src/setting.h +++ b/src/setting.h @@ -30,7 +30,7 @@ class Setting { class SettingChangeBase { public: - virtual ~SettingChangeBase() {} + virtual ~SettingChangeBase() = default; virtual void pop() = 0; }; diff --git a/src/singledocparser.cpp b/src/singledocparser.cpp index be82741..52544dd 100644 --- a/src/singledocparser.cpp +++ b/src/singledocparser.cpp @@ -21,7 +21,7 @@ SingleDocParser::SingleDocParser(Scanner& scanner, const Directives& directives) m_anchors{}, m_curAnchor(0) {} -SingleDocParser::~SingleDocParser() {} +SingleDocParser::~SingleDocParser() = default; // HandleDocument // . Handles the next document diff --git a/src/streamcharsource.h b/src/streamcharsource.h index 4b6a143..6259d16 100644 --- a/src/streamcharsource.h +++ b/src/streamcharsource.h @@ -13,12 +13,11 @@ namespace YAML { class StreamCharSource { public: StreamCharSource(const Stream& stream) : m_offset(0), m_stream(stream) {} - StreamCharSource(const StreamCharSource& source) - : m_offset(source.m_offset), m_stream(source.m_stream) {} + StreamCharSource(const StreamCharSource& source) = default; StreamCharSource(StreamCharSource&&) = default; StreamCharSource& operator=(const StreamCharSource&) = delete; StreamCharSource& operator=(StreamCharSource&&) = delete; - ~StreamCharSource() {} + ~StreamCharSource() = default; operator bool() const; char operator[](std::size_t i) const { return m_stream.CharAt(m_offset + i); }