From d770a7dc9725fbd2262628d54b6fd680d916852a Mon Sep 17 00:00:00 2001 From: Jeff Wang Date: Tue, 17 Jul 2012 11:55:45 -0500 Subject: [PATCH] workaround for gcc 3 --- include/yaml-cpp/node/convert.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/yaml-cpp/node/convert.h b/include/yaml-cpp/node/convert.h index f78332a..6f19d8e 100644 --- a/include/yaml-cpp/node/convert.h +++ b/include/yaml-cpp/node/convert.h @@ -138,7 +138,12 @@ namespace YAML rhs.clear(); for(const_iterator it=node.begin();it!=node.end();++it) +#if defined(__GNUC__) && __GNUC__ < 4 +//workaround for GCC 3: + rhs[it->first.template as()] = it->second.template as(); +#else rhs[it->first.as()] = it->second.as(); +#endif return true; } }; @@ -159,7 +164,12 @@ namespace YAML rhs.clear(); for(const_iterator it=node.begin();it!=node.end();++it) +#if defined(__GNUC__) && __GNUC__ < 4 +//workaround for GCC 3: + rhs.push_back(it->template as()); +#else rhs.push_back(it->as()); +#endif return true; } }; @@ -180,7 +190,12 @@ namespace YAML rhs.clear(); for(const_iterator it=node.begin();it!=node.end();++it) +#if defined(__GNUC__) && __GNUC__ < 4 +//workaround for GCC 3: + rhs.push_back(it->template as()); +#else rhs.push_back(it->as()); +#endif return true; } };