16 template <
typename FunctorT>
33 template <
typename FunctorT>
35 using F =
typename std::decay<FunctorT>::type;
auto MoveHandler(FunctorT &&func)
下面是一种hack,用于绕过Asio库的限制,使其能够接受仅可移动的处理程序。 如果Asio试图复制一个仅可移动的处理程序,那么编译时可能不会立即报错
MoveWrapper(FunctorT &&f)
MoveWrapper & operator=(const MoveWrapper &)
MoveWrapper(const MoveWrapper &)
MoveWrapper(MoveWrapper &&)=default
MoveWrapper & operator=(MoveWrapper &&)=default