From: Eric Friedman (ebf_at_[hidden])
Date: 2003-08-29 23:12:26
Oops! I forgot to attach the test file!
It's now attached.
Eric Friedman wrote:
> Dear Boosters,
> I've recently added reference support to variant. For instance, the
> following is now supported:
> int i = 3;
> boost::variant<int&, double&> var(i);
> i = 2;
> BOOST_CHECK( boost::get<int>(var) == 2 );
> However, such support required the addition of an additional variant
> template <typename T> variant( T& );
> which subsequently determines whether to treat the passed reference as a
> reference-qua-reference or rather as a reference to some object.
> Unfortunately, the addition of this constructor seems to have broken
> under Metrowerks in some situations. So far, I have discovered that
> variants cause a problem when implicit conversions to these embedded
> variants occur. If the preceding description is unclear, the attached file
> demonstrates the problem in code.
> The attached code compiles and runs successfully on MSVC 6.5, MSVC 7.1,
> 3.2, and Borland 5.5.1, but I cannot get it to compile under CodeWarrior
> 8.3. The compiler complains about "ambiguous access to overloaded
> My first instinct is to disable reference support for CodeWarrior (as
> #defining BOOST_VARIANT_NO_REFERENCE_SUPPORT does solve the problem), but
> CodeWarrior is generally a quite conformant compiler. I therefore hope
> someone might find a workaround.
> Of course, I will gladly assist (in explaining variant's internals, etc.)
> anyone who steps up to the challenge.
begin 666 test.cpp
M#0H-"B @("!C;VYS="!I;G0@=&5S=%]V86QU92 ](#,[#0H@(" @=F%R7W0@
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk