|
Boost : |
From: Dill, John (john-dill_at_[hidden])
Date: 2004-04-15 15:21:54
> Hello John,
>
> There's a big technical reason:
>
> If bind would have reference semantics, you could not do this:
>
> bind(f, 1, _1)
>
> Bind would have to take its arguments as
>
> template <class F, class A, class B, ...>
> bind( F, A&, B&, ...)
>
> 1 is a non-const rvalue, which cannot be bound to non-const reference.
I think I almost got it now, but I'm still a little confused about bind_template.hpp where the list template parameters are A1&, A2&, A3&, ...
list1 for example stores a template parameter A1 as "A1 a1;". So this ends up not actually being a reference to a normal type T, but to the value<T> wrapper class? If not, what type is actually A1& in the listN declarations in bind_template.hpp?
Thanks,
John
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk