diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h index 69db1b7..50af6b6 100644 --- a/include/yaml-cpp/node/impl.h +++ b/include/yaml-cpp/node/impl.h @@ -87,7 +87,7 @@ struct as_if { explicit as_if(const Node& node_) : node(node_) {} const Node& node; - const T operator()(const S& fallback) const { + T operator()(const S& fallback) const { if (!node.m_pNode) return fallback; @@ -140,14 +140,14 @@ struct as_if { // access functions template -inline const T Node::as() const { +inline T Node::as() const { if (!m_isValid) throw InvalidNode(); return as_if(*this)(); } template -inline const T Node::as(const S& fallback) const { +inline T Node::as(const S& fallback) const { if (!m_isValid) return fallback; return as_if(*this)(fallback); diff --git a/include/yaml-cpp/node/node.h b/include/yaml-cpp/node/node.h index 4ec3543..1207f6e 100644 --- a/include/yaml-cpp/node/node.h +++ b/include/yaml-cpp/node/node.h @@ -63,9 +63,9 @@ class YAML_CPP_API Node { // access template - const T as() const; + T as() const; template - const T as(const S& fallback) const; + T as(const S& fallback) const; const std::string& Scalar() const; const std::string& Tag() const;