Wednesday, 21 August 2013

no matching function for call to

no matching function for call to

I've this code:
class XMLNode
{
.
.
.
.
template <typename T>
bool getValue(T& t, const std::string& path) const
{
if (empty())
{
throw std::runtime_error("Empty node");
}
return nsXML::getValue(t, path, *node);
}
template <typename T>
T getValue(const std::string& path) const
{
if (empty())
{
throw std::runtime_error("Empty node");
}
return nsXML::getValue<T>(path, *node);
}
.
.
.
.
};
class XMLData
{
.
.
.
.
template <typename T>
T getValue(const std::string& path)
{
return XMLNode(&mDocNode, 0).getValue(path); // ERROR LINE
}
.
.
.
};
And give me error
no matching function for call to 'nsXML::XMLNode::getValue(const string&)'
note: candidates are: note: template bool nsXML::XMLNode::getValue(T&,
const string&) const note: template T nsXML::XMLNode::getValue(const
string&) const
Why ? g++ give me this error?

No comments:

Post a Comment