From 4d77eee9f149877968a2c37502bf5722098ff03a Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 28 Apr 2021 16:38:57 +0200 Subject: [PATCH] fixes of introduced bug --- include/yaml-cpp/node/convert.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/yaml-cpp/node/convert.h b/include/yaml-cpp/node/convert.h index 099faaf..70927dd 100644 --- a/include/yaml-cpp/node/convert.h +++ b/include/yaml-cpp/node/convert.h @@ -66,10 +66,11 @@ template <> struct convert { static Node encode(const Node& rhs) { return rhs; } - static bool decode(const Node& node, Node& rhs) { //FIXME, this is dangerous + static Node decode(const Node& node) { //FIXME, this is dangerous throw std::runtime_error("this should not have been encountered"); + Node rhs; rhs.reset(node); - return true; + return rhs; } }; @@ -185,7 +186,7 @@ ConvertStreamTo(std::stringstream& stream, T& rhs) { } \ type rhs; \ if (conversion::ConvertStreamTo(stream, rhs)) { \ - throw conversion::DecodeException(""); \ + return rhs; \ } \ if (std::numeric_limits::has_infinity) { \ if (conversion::IsInfinity(input)) { \