From: Itay Maman (itay_maman_at_[hidden])
Date: 2002-07-21 17:55:52
"David Abrahams" <david.abrahams_at_[hidden]> wrote in message
> 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
> > 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:
boost::variant<int, double> v;
int* p = extract<int>(&v);
It works fine with GCC, but breaks MSVC.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk