Boost logo

Boost Users :

Subject: Re: [Boost-users] [Variant] recursive_wrapper and ambiguous convert_construct()
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-04-11 16:04:27


On Wed, Apr 11, 2012 at 11:48 AM, Florian Goujeon <
florian.goujeon_at_[hidden]> wrote:

> On 04/09/2012 08:23 PM, Jeffrey Lee Hellrung, Jr. wrote:
>
> c_fwd inherits from c, which is the variant<double,char*> 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



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net