
15 Jun
2010
15 Jun
'10
11:12 a.m.
Zitat von Stefan Strasser <strasser@uni-bremen.de>:
does Boost.Bind contain anything to create a function object that is statically bound to a member function?
since I haven't found anything, I think this would be a useful addition to boost.MemFn. (although it might be performance nitpicking...) template<class F> __declspec(noinline) void dispatch(F f){ f(); } int main(){ A a; //compiler inlines A::f into dispatch() dispatch(boost::bind(smem_fun<void (A::*)(),&A::f>(),&a)); //compiler can't inline A::f into dispatch(). indirect function //call is used. dispatch(boost::bind(std::mem_fun(&A::f),&a)); }