
27 Feb
2013
27 Feb
'13
4:29 a.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