std::function and smart_pointers