Boost logo

Boost :

From: Itay Maman (itay_maman_at_[hidden])
Date: 2002-07-21 17:55:52


"David Abrahams" <david.abrahams_at_[hidden]> wrote in message
news:144a01c230d8$2d942d30$6501a8c0_at_boostconsulting.com...
>
> From: "Itay Maman" <itay_maman_at_[hidden]>
>
> > >
> > > template <class T, class U>
> > > whatever extract(variant<U> const&, boost::type<T>* = 0);
> > >
> > This Practically creates two different interfaces: Code written for GCC
> (for
> > example) will not work under MSVC since all the
> > "extract<T>(x);" calls will not work. (I'd be glad to stand corrected if
> > this is not the case).
>
> Then so stand.
> I do this all the time and it works fine with GCC.
> Why did you think it wouldn't work?
>
The problem is on the opposite direction. Consider this piece:
   using boost::extract;
   boost::variant<int, double> v;
    int* p = extract<int>(&v);

It works fine with GCC, but breaks MSVC.

-Itay.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk