
5 Dec
2012
5 Dec
'12
1:08 a.m.
On Tue, Dec 4, 2012 at 4:20 PM, Steve Lorimer <steve.lorimer@gmail.com> wrote:
Try call the result:
Steve, Thank you. That was pretty boneheaded of me to leave out. Another way to get the compiler failure is to just store the result: //function<void()> x = bind(b, bind(a)); function<void()> x = bind(b, cref(bind(a))); I will paste the corrected demo below. Thank you, Chris === #include <boost/bind.hpp> #include <boost/function.hpp> using boost::bind; using boost::cref; using boost::function; void a() { } void b(function<void()>) { } void f() { //function<void()> x = bind(b, bind(a)); function<void()> x = bind(b, cref(bind(a))); } === $ g++ --version g++ (Gentoo 4.5.4 p1.0, pie-0.4.7) 4.5.4