From 537063f907b83972101a027ba8895204ddf1627d Mon Sep 17 00:00:00 2001 From: beder Date: Wed, 11 Jan 2012 13:58:18 -0600 Subject: [PATCH] Added explicit conversion from an iterator value to a Node. This conversion was always allowed (since the iterator value is derived from Node, but since Node has a templated constructor, that would take precedence over the derived-to-base conversion. This didn't seem to be a problem in gcc or clang, but MSVC seems to have trouble. (new API) --- include/yaml-cpp/node/impl.h | 4 ++++ include/yaml-cpp/node/node.h | 1 + 2 files changed, 5 insertions(+) diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h index 3120c79..e379461 100644 --- a/include/yaml-cpp/node/impl.h +++ b/include/yaml-cpp/node/impl.h @@ -29,6 +29,10 @@ namespace YAML Assign(rhs); } + 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_pMemory(rhs.m_pMemory), m_pNode(rhs.m_pNode) { } diff --git a/include/yaml-cpp/node/node.h b/include/yaml-cpp/node/node.h index bab6829..8066057 100644 --- a/include/yaml-cpp/node/node.h +++ b/include/yaml-cpp/node/node.h @@ -26,6 +26,7 @@ namespace YAML Node(); explicit Node(NodeType::value type); template explicit Node(const T& rhs); + explicit Node(const detail::iterator_value& rhs); Node(const Node& rhs); ~Node();