Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2007-09-20 17:15:40


Boris Gubenko wrote:
> Another way of fixing it, the one that does not involve explicit
> specialization, can be defining foo's template ctor after make_foo()
> has been defined (or declared):
>
> ---%<---
> struct foo
> {
> foo() {}
> template <class T> foo(T);
> };
>
> inline foo make_foo(int i) { return foo(); }
>
> template <class T> foo::foo(T t) { *this = make_foo(t); }
>
> foo f(42);
> --->%---

I went with the fix from Markus because I thought it might be less prone
to ordering failure for user supplied overloads. That's just
speculation; I don't have easy access to a compiler I can test against.

Thanks,

--Beman


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