LoginSignup
0
0

More than 5 years have passed since last update.

[boost] asio::io_service でmove-only handlerをpushする

Posted at

io_service::pushの引数に渡すハンドラにコピーコンストラクタが無いと怒られる。
accept時にsocketunique_ptrで束縛してハンドラに処理を任せたいときに不便である。

workaroundとしては、コピーコンストラクタを宣言するラッパーを書いて、定義はしないという方法がある。
ちなみにコピー代入演算子の方は無くても良い。

http://stackoverflow.com/questions/17211263/how-to-trick-boostasio-to-allow-move-only-handlers
https://svn.boost.org/trac/boost/ticket/8714

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0