Rokiのチラ裏

学生による学習のログ

2017-12-07から1日間の記事一覧

implicitly capture の振る舞い

C++

以下の例が成り立つ。 const int i = 123; // #1 const float f = 123.f; // #2 []{ i; }(); // OK []{ f; }(); // ill-formed C++17 のラムダ式における reaching scope に関する記述 n4659/[expr.prim] 3, 7, n4659/[expr.prim.lambda.capture] 8 から引用…