"example/53_gemv_splitk/common.hpp" did not exist on "b94fd0b2279c6476c6e109e99dc5d0e6d8ce313c"
Commit d1c888f5 authored by jbeder's avatar jbeder
Browse files

Added templated Read() function that creates the output variable itself (so...

Added templated Read() function that creates the output variable itself (so you don't need to have a temp variable)
parent c456eab7
......@@ -49,6 +49,9 @@ namespace YAML
template <typename T>
bool Read(T& value) const;
template <typename T>
const T Read() const;
template <typename T>
friend void operator >> (const Node& node, T& value);
......
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment