std::bind is quirky.
Replace your use of std::bind with:
template<class T, class Sig> struct bound_member; template<class T, class R, class...Args> struct bound_member<T, R(Args...)> { T* t; R(T::*m)(Args...); R operator()(Args...args)const { return (t->*m)(std::forward<Args>(args)...); }; template<class T, class R, class...Args> bound_member<T,R(Args...)> bind_member( T* t, R(T::*m)(Args...) ) { return {t,m}; } template<class T, class R, class...Args> bound_member<T,R(Args...)> bind_member( T& t, R(T::*m)(Args...) ) { return {&t,m}; } template<class T, class R, class...Args> bound_member<T,R(Args...)> bind_member( T&& t, R(T::*m)(Args...) ) =delete; // avoid lifetime issues?
and now auto bnd = bind_member(s, S::calc); should make your code work.
There are few situations where a lambda isn't a better idea than std::bind, especially by C++14. In C++11, there are some corner cases, but even then I usually prefer to write my own binders without the quirks of std::bind.
packaged_task, it's your use ofbind. Remove thepackaged_taskand try callingbnd(1)and see what happens.