From d0075166ec261d0395d323afa9a19cf6f5badc1c Mon Sep 17 00:00:00 2001 From: theNerd247 Date: Thu, 7 Jul 2016 11:31:32 -0400 Subject: [PATCH] added fully defined templates for std containers * updated containers for: vector, map, and list to use fully defined template parameters as per the std lib. --- include/yaml-cpp/node/convert.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/yaml-cpp/node/convert.h b/include/yaml-cpp/node/convert.h index f388a67..18f9482 100644 --- a/include/yaml-cpp/node/convert.h +++ b/include/yaml-cpp/node/convert.h @@ -161,17 +161,17 @@ struct convert { }; // std::map -template -struct convert > { - static Node encode(const std::map& rhs) { +template +struct convert > { + static Node encode(const std::map& rhs) { Node node(NodeType::Map); - for (typename std::map::const_iterator it = rhs.begin(); + for (typename std::map::const_iterator it = rhs.begin(); it != rhs.end(); ++it) node.force_insert(it->first, it->second); return node; } - static bool decode(const Node& node, std::map& rhs) { + static bool decode(const Node& node, std::map& rhs) { if (!node.IsMap()) return false; @@ -188,17 +188,17 @@ struct convert > { }; // std::vector -template -struct convert > { - static Node encode(const std::vector& rhs) { +template +struct convert > { + static Node encode(const std::vector& rhs) { Node node(NodeType::Sequence); - for (typename std::vector::const_iterator it = rhs.begin(); + for (typename std::vector::const_iterator it = rhs.begin(); it != rhs.end(); ++it) node.push_back(*it); return node; } - static bool decode(const Node& node, std::vector& rhs) { + static bool decode(const Node& node, std::vector& rhs) { if (!node.IsSequence()) return false; @@ -215,17 +215,17 @@ struct convert > { }; // std::list -template -struct convert > { - static Node encode(const std::list& rhs) { +template +struct convert > { + static Node encode(const std::list& rhs) { Node node(NodeType::Sequence); - for (typename std::list::const_iterator it = rhs.begin(); + for (typename std::list::const_iterator it = rhs.begin(); it != rhs.end(); ++it) node.push_back(*it); return node; } - static bool decode(const Node& node, std::list& rhs) { + static bool decode(const Node& node, std::list& rhs) { if (!node.IsSequence()) return false;