diff --git a/include/yaml-cpp/node/convert.h b/include/yaml-cpp/node/convert.h index f232de7..51b617e 100644 --- a/include/yaml-cpp/node/convert.h +++ b/include/yaml-cpp/node/convert.h @@ -162,17 +162,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; @@ -189,17 +189,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; @@ -216,17 +216,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;