Boost Users :
Subject: Re: [Boost-users] [function] Automatic boost::ref for functors?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-11-12 15:56:27
Robert Dailey wrote:
> 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() );
Wouldn't that create a dangling reference?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net