e72adbc6ca
Currently, Dart heap objects are non-copyable. For this reason, code such as > const Function& f = ... > USE(f); would not compile. Doing this can be useful when doing initial testing runs of one's code. Of course, the problem generalises to other kinds of objects. This CL fixes the issue by changing the template function to use a universal reference. The other beneficial aspect of this change is that when a copyable class is passed to USE, it will no longer be copied. Tested: all trybots, see results. Change-Id: Ic1497067e2228b1b59806ddad8df9e85d87f4c27 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162502 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Andrei Constantinescu <andreicostin@google.com>