From 67d029b7b101ac22e493fdfe85aff5a710d06d55 Mon Sep 17 00:00:00 2001 From: dekken Date: Sun, 24 Mar 2019 23:14:28 +0100 Subject: [PATCH] moved move/copyop to cpp for MSVC --- include/yaml-cpp/parser.h | 5 +++-- src/parser.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/yaml-cpp/parser.h b/include/yaml-cpp/parser.h index 2f403c3..a03c863 100644 --- a/include/yaml-cpp/parser.h +++ b/include/yaml-cpp/parser.h @@ -28,10 +28,11 @@ class YAML_CPP_API Parser { /** Constructs an empty parser (with no input. */ Parser(); + /** non copyable but movable */ Parser(const Parser&) = delete; - Parser(Parser&&) = delete; Parser& operator=(const Parser&) = delete; - Parser& operator=(Parser&&) = delete; + Parser(Parser&&); // = default // moved to cpp for MSVC + Parser& operator=(Parser&&); // = default // moved to cpp for MSVC /** * Constructs a parser from the given input stream. The input stream must diff --git a/src/parser.cpp b/src/parser.cpp index 7bc0c78..edc3b79 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -17,6 +17,9 @@ Parser::Parser(std::istream& in) : Parser() { Load(in); } Parser::~Parser() {} +Parser::Parser(Parser&&) = default; +Parser& Parser::operator=(Parser&&) = default; + Parser::operator bool() const { return m_pScanner.get() && !m_pScanner->empty(); }