Boost logo

Boost :

Subject: Re: [boost] [variant] Why boost::get<Base>(derived) not supported?
From: TONGARI J (tongari95_at_[hidden])
Date: 2013-12-07 08:23:28

Hi Antony,

2013/12/7 Antony Polukhin <antoshkka_at_[hidden]>

> 2013/12/7 TONGARI J <tongari95_at_[hidden]>
> > Hi there,
> >
> > You can see the idea here:
> >
> >
> > Is there any technical reason not having boost::get work like that?
> >
> I like the idea of polymorthic_get<>. Created a ticket
> But I'm not sure that boost::get<> by default must work in that way.

Not a must, but intuitive to do so for me.

Won't there be ambiguity with `operator Base()`? And what if the user
> stores Base
> and Derived in boost::variant and want to chek that Base is stored in
> variant, not Derived?

Maybe we can promote this idea to something more general, like
'variant_cast', not necessary have to be in base-derived relationship but
just something convertible.

Does that make sense?


Boost list run by bdawes at, gregod at, cpdaniel at, john at