On Mon, Apr 9, 2012 at 8:48 AM, Florian Goujeon wrote: Hello, I'm modelizing a syntax tree using boost::variant, std::tuple and
std::vector. This syntax tree has a lot of cyclic dependencies, so I have
to use boost::recursive_wrapper along with forward declarations. I've encountered a case that my compiler (GCC 4.7) refuses to build.
Here is the source code: http://pastebin.com/3a5xU06x (it's pretty short)
Here is the compilation error message: http://pastebin.com/Zpa3TCp2 (Of course, reordering the declarations would solve the problem in this
example, but it's not the point. This is a constraint I can't get rid of
in my whole project.) The compiler complains about an ambiguous call of convert_construct() in
Boost's source code, where a comment says:
NOTE TO USER :
Compile error here indicates that the given type is not
unambiguously convertible to one of the variant's types
(or that no conversion exists). c can be converted to boost::recursive_wrapper I really don't know what to do. Help would be appreciated.
Thank you. It *looks* like it's getting confused with the conversion constructor that
constructs one variant type from another.
Let's see, it's trying to match
convert_construct(c_fwd&, long int)
and the candidates it's considering are
variant< rw