I have the following code:
#include <boost/property_tree/ptree.hpp>
class A {
public:
const boost::property_tree::ptree & ptree() const {
return _pt;
}
private:
boost::property_tree::ptree _pt;
};
class B : public A {
public:
int bla() const {
return ptree().get<int>("bla",0);
}
};
template<class T>
class C : public A {
public:
int bla() const {
return ptree().get<int>("bla",0);
}
};
So both classes B and C access the boost property tree inherited from A and call the templated method get("bla",0) on it. The only difference between B and C is the fact that C itself is a templated class. However for C I get the compiler error
test.cpp:22:31: error: expected unqualified-id before ‘>’ token
return ptree().get<int>("bla",0);
^
This is for GCC 4.8.3
It also works fine if B and C have their own property tree _ptree and do not access it via a call to A::ptree()
. Is it a bug or do I miss something here.
Thank you very much indeed.