
26 Feb
2013
26 Feb
'13
9:29 p.m.
On Tue, Feb 26, 2013 at 8:06 PM, Chris Stankevitz <chrisstankevitz@gmail.com> wrote:
boost::function<int&(TCObject*)> GetFunctionThatReturnsRefX_2() { return boost::bind(&TCObject::x, _1); }
Solution: Bind takes a template argument that is the return type when using class members: boost::function<int&(TCObject*)> GetFunctionThatReturnsRefX_2() { return boost::bind<int&>(&TCObject::x, _1); } Chris