What steps will reproduce the problem?
struct A {};
struct B: public A {};
void operator >> (const YAML::Node& node, A& a) {}
int main()
{
YAML::Node node;
A a;
node >> a;
B b;
node >> b;
return 0;
}
What is the expected output? What do you see instead?
The above code does not compile. The error, on the line `node >> b`, is due to
the `operator >> ` in node.h being an exact match, and hence better than the
conversion `B&` to `A&`; but then there is no Convert() function for B, so
compilation of *that* `operator >>` fails.
Instead, use SFINAE to cause the existing `operator >>` not to compile unless
there is a Convert() function for it.
Original issue reported on code.google.com by jbe...@gmail.com on 1 Nov 2011 at 10:18
Original issue reported on code.google.com by
jbe...@gmail.com
on 1 Nov 2011 at 10:18