Value http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0018r0.html P0018R1 : Lambda Capture of *this by Value http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0018r1.html P0018R2 : Lambda Capture of *this by Value as [=,*this] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0018r2.html P0018R3 : Lambda Capture of *this by Value as [=,*this] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0018r3.html
i) : i(i) {} int i; auto f() { return [=]{ return i; }; } }; int main() { auto s = S(42); auto l = s.f(); std::cout << l() << '¥n'; } デフォルトコピーキャプチャでも、 メンバ変数は this 経由でのアクセス なので、実質参照キャプチャ C++20 だと デフォルトコピーキャプチャだけで this にアクセスするのは非推奨…
int i = 0; auto r = std::from_chars(s, s + sizeof(s) - 1, i); assert(i == 42); assert(r.ptr == s + 2); assert(r.ec == std::errc{}); ※ r.ptr は数値として解釈できない文字(この場合は"k")を指す。 (エラーではない) ちなみに、ここでは説明のため敢えて r で受けてるけど普通は構造化束縛使うよね…
int i = 114'514; auto r = std::from_chars(s, s + sizeof(s) - 1, i); assert(i == 114'514); assert(r.ptr == s); assert(r.ec == std::errc::invalid_argument); ※ エラーの時は i は変わらず、r.ptr は数値として解釈できない文 字(この場合は"+")を指す。
int i = 42; auto r = std::from_chars(s, s + sizeof(s) - 1, i, 16); assert(i == 0); assert(r.ptr == s + 1); assert(r.ec == std::errc{}); ※ エラーじゃなくて、先頭の0だけ変換されてる。(わりとワナ)
to use Additional Searching Algorithms http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3606.html N3703: Extending std::search to use Additional Searching Algorithms (Version 3) http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3703.html P0253R0: Fixing a design mistake in the searchers interface in Library Fundamentals http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0253r0.pdf P0253R1: Fixing a design mistake in the searchers interface in Library Fundamentals http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0253r1.pdf
support for standard containers http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4056.html N4371 Minimal incomplete type support for standard containers, revision 2 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4371.html N4390 Minimal incomplete type support for standard containers, revision 3 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4390.html N4510 Minimal incomplete type support for standard containers, revision 4 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510.html