The existing comment is wrong, and the test even ensures it: Bind will capture reference values by reference. That makes it hard to use with AsyncInvoker, because you can't safely Bind to a function that takes (const) reference params.
The new version of this code strips references in the bound object, so it captures by value, but can bind against functions that take const references, they'll just be references to the copy.
As the class comment implies, actual by-reference args should be passed as pointers or things that safely share (e.g. scoped_refptr) and not references directly. A new test case ensures the pointer reference works. The new code will also give a compiler error if you try to bind
to a non-const reference.
BUG=
Review URL: https://codereview.webrtc.org/1291543006
Cr-Commit-Position: refs/heads/master@{#10397}
This patch basically deletes webrtc/base/template_util.h (which is the
more outdated copy, although there are only cosmetical differences)
and moves webrtc/system_wrappers/source/template_util.h to take its
place.
The reunified header uses the rtc namespace like the old
webrtc/base/template_util.h, rather than the webrtc namespace like
webrtc/system_wrappers/source/template_util.h.
R=aluebs@webrtc.org, andrew@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/38579004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8050 4adac7df-926f-26a2-2b94-8c16560cd09d