Added templated Read() function that creates the output variable itself (so you don't need to have a temp variable)

This commit is contained in:
Jesse Beder
2009-08-19 03:37:19 +00:00
parent 487f381ae9
commit d92ca21bcc
2 changed files with 10 additions and 0 deletions

View File

@@ -16,6 +16,13 @@ namespace YAML
return Convert(scalar, value);
}
template <typename T>
inline const T Node::Read() const {
T value;
*this >> value;
return value;
}
template <typename T>
inline void operator >> (const Node& node, T& value) {
if(!node.Read(value))