Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-02-22 15:27:39


"Rani Sharoni" <rani_sharoni_at_[hidden]> writes:

> The above code compiled fine with VC7.1 beta but failed to compile using EDG
> and GCC.
> Here is an explanation for why I think that it's compliant:
>
> The form of the ctor of ctor_tester is the same as its member t (12.8/5). In
> case the ctor argument has const qualifier then both check functions has an
> exact match (13.3.3.1.1/3), the first check using Lvalue-transformation and
> the second using identity. The ambiguity buster in this case is the
> non-template function.
> In case that the ctor is not const then the first version is viable using
> user defined conversion sequence (like auto_ptr: ctor_tester -> B) and the
> second is still identity.
>
> Overloading is so complex that I have doubts and I'll be happy to ear a
> second opinion.

Very interesting; I think your explanation is reasonable.
Unfortunately, cwpro8.3 also disagrees with you. I spent several
hours hacking around with this to make various compilers other than
vc7.1 accept it, and failed.

Thanks for trying,
Dave

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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