On Wed, Apr 11, 2012 at 11:48 AM, Florian Goujeon < florian.goujeon@42ndart.org> wrote:
On 04/09/2012 08:23 PM, Jeffrey Lee Hellrung, Jr. wrote:
c_fwd inherits from c, which is the variant
that pops up above. So yeah, there's definitely an ambiguity there.
Since boost.variant seems confused by this public inheritance, I'll try to write a wrapper instead:
class my_type { private: boost::variant<...> impl_;
public: //interface of impl_ };
It's too bad C++ doesn't ease such writtings.
Well, it kinda does: inheritance; but it doesn't let you disable the derived -> base conversion :/ does that help you diagnose the problem in any way?
It does. Thank you, Jeff!
Hmmm, okay, that's good 'cause I've since forgotten the problem :) If you think some SFINAE trick can be used to disambiguate the constructor call, consider filing a trac ticket for Boost.Variant with this example. Or, if possible, an even simpler example, 'cause I remember finding even this stripped-down example hard to wrap my head around :/ And if you can provide a solution, even better! Again, I've since forgotten the problem, but I do remember that it wasn't immediately obvious to me whether this was a problem Boost.Variant should be able to handle or not. - Jeff