Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-10-31 21:07:26


Douglas Gregor <gregod_at_[hidden]> writes:

> On Wednesday 30 October 2002 11:50 am, David Abrahams wrote:
> > The docs show this constructor:
> >
> > explicit signal(const Combiner& = Combiner(), const GroupCompare& =
> > GroupCompare());
> >
> > I think it should say:
> >
> > explicit signal(Combiner = Combiner(), GroupCompare = GroupCompare());
> >
> > Even though that's not the actual signature in the library, since
> > these objects will be copied (a convention that is used in the
> > standard also).
>
> That's interesting... Woudl you even do this with a signature like:
>
> template<typename T> void foo(const T&)
>
> ?

Yes.

> I ask because this would have different semantics than:
>
> template<typename T> void foo(T);
>
> when passed a function (because there is no reference to const function).

In general users are prohibited from taking the address of standard
library functions, because the implementor is free to add undocumented
default arguments and overloads. I think the same should apply to
boost.

-- 
                    David Abrahams
dave_at_[hidden] * http://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