mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 04:51:17 +00:00
Allow using a Node as the key in force_insert.
Node::force_insert() uses convert<> to convert its key to a node. Add a specialization for convert<Node>.
This commit is contained in:

committed by
Jesse Beder

parent
03d6e7d672
commit
320b02b14a
@@ -43,6 +43,17 @@ inline bool IsNaN(const std::string& input) {
|
||||
}
|
||||
}
|
||||
|
||||
// Node
|
||||
template <>
|
||||
struct convert<Node> {
|
||||
static Node encode(const Node& rhs) { return rhs; }
|
||||
|
||||
static bool decode(const Node& node, Node& rhs) {
|
||||
rhs.reset(node);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
// std::string
|
||||
template <>
|
||||
struct convert<std::string> {
|
||||
|
Reference in New Issue
Block a user