
15 Apr
2004
15 Apr
'04
8:21 p.m.
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