Using Visual Studio 2013 RC and C++, I\'m trying to pass an std::unique_ptr to a function that has been bound using std::bind. However, I\'m having
std::unique_ptr
std::bind
You have to move the parameter into the bound call to func also. Not only in the invocation of bound
func
bound
bound(std::move(ptr));
but also in the binding:
std::function)> bound = std::bind(func, std::bind(std::move&>, std::placeholders::_1));
This is compiling in VS2013 (update 4) for me.