Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2002-10-08 18:36:24


"David B. Held" <dheld_at_[hidden]> wrote in message
news:anvoad$24i$1_at_main.gmane.org...
> [...]
> However, one of my tests fails, and it's probably because it's calling
> the wrong constructor.
> [...]

In fact, it is. On a hunch, I rearranged some of the c'tors to draw the
rather
suprising conclusion that gcc now mistakenly chooses a c'tor that bcc
handles properly! Instead of selecting the conversion c'tor:

template <typename U>
ref_counted(ref_counted<U> const& rhs);

it greedily chooses the catch-all c'tor:

template <typename U>
ref_counted(U const&);

The solution is to provide a pointer-specific c'tor, and hope that it
catches implicit conversions properly:

ref_counted(P const&);

Oh well. I'd still like to know about how types pass through MPL.
Judging from error messages and the like, they appear to pass through
unscathed, but I don't know how reliable that is.

Dave


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