[function] Automatic boost::ref for functors?

12 Nov
2008
12 Nov
'08
8:47 p.m.
Hi, I noticed in the Boost.Function documentation here that it explains how to pass a reference to a function object into a boost::function. Is there a way to make boost::function automatically take the reference of any function object it is given? For example: boost::function<void (int)> f; f = MyFunctionObject(); // This is an implicit: f = boost::cref( MyFunctionObject() ); Help is appreciated!
6071
Age (days ago)
6071
Last active (days ago)
2 comments
2 participants
participants (2)
-
Robert Dailey
-
Steven Watanabe