
30 Jun
2009
30 Jun
'09
8:02 p.m.
2009/6/30 Zachary Turner <divisortheory@gmail.com>:
However, once the code is inside the body of foo, the addresses of x inside foo and the addresses of x when I called bind are different. So somehow a copy is being made. I can get around it by using boost::ref(), but is there a technical reason why it doesn't "just work" and pass it by reference?
Well there's no way to tell that it's a reference, so it has to pick one or the other. Presumably it chose by-value for default to match function argument passing.