Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2001-09-19 10:16:36


on 9/19/01 5:12 AM, Peter Dimov at pdimov_at_[hidden] wrote:

> Your analysis is incorrect, I believe. A reference binding doesn't count as
> an implicit conversion.

Why do you say that a reference binding doesn't count as an implicit
conversion? I've read the standard carefully, and it seems clear to me that
it does. Paragraph 4p3 seems to address this specifically. Can you quote
chapter and verse that shows that a reference binding is not an implicit
conversion?

> Consider this simpler example:
>
> template<class T> void f(T const &);
> template<class T> void f(T * const &);

This simpler example does demonstrate the problem that the working group is
looking into in issue 214, but it's not related to my original point.
Metrowerks chooses the second template.

> My own opinion is that
>
> template<class F> void function(F f);
>
> is not that bad. The standard library always takes function objects by
> value.

I agree.

    -- Darin


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