1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[c++] キャプチャしていないラムダは関数ポインタとして扱える

1
Last updated at Posted at 2017-12-08

SIGINT を受けた場合に handler内でステートマシンのイベントを発火しようと考えた。

そのときに、キャプチャの有無によってエラーが発生し、
キャプチャしていないラムダが関数ポインタに渡せることを知ったので残しておく。

コード

ただ、SIGINT の handler内でやれることは決まっており、未定義動作が発生しうるとのこと。
-> 生のsignalを使うより libev の ev::sig を使ったほう便利。

参照

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?