Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-01-15 16:52:07


From: "Jens Maurer" <Jens.Maurer_at_[hidden]>

> > template<class T> void f(T const & t);
> >
> > void g();
> >
> > f(g);
> >
> > Is icl 5 right in rejecting this? (a non-const reference works.)
>
> I believe so. See the thread starting at
> http://www.egroups.com/message/boost/6633
> for some more explanation.

Thanks, I remember the thread now. It makes sense.

I tried to switch to pass-by-value:

struct X
{
    template<class T> explicit X(T);
    template<class T> X & operator= (T);
};

... and received all kinds of weird results from the compilers. Only g++
2.95.2 works as I expect, preferring the implicit copy constructor and
assignment operator over the template versions.

Back to the drawing board.

--
Peter Dimov
Multi Media Ltd.

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