65. ジェネリックラムダ
auto の意味
65
さっきの例
[](auto a, auto b) { return a + b; }
⇓
struct 絶対アクセスできないユニークな名前 {
template<typename T, typename U>
auto operator()(T a, U, b) const {
return a + b;
}
};
66. ジェネリックラムダ
auto の意味
66
ラムダキャプチャはコンストラクタの引数
[v = 42](auto a, auto b) { return a + b; }
⇓
struct 絶対直接アクセスできないユニークな名前 {
絶対直接アクセスできないコンストラクタ(int v) : v(v) {}
template<typename T, typename U>
auto operator()(T a, U, b) const {
return a + b;
}
private:
int v;
};
71. 通常関数の戻り値型推論
N2954 Unified Function Syntax
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2954.html
N3386 Return type deduction for normal functions
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3386.html
N3582 Return type deduction for normal functions
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3582.html
N3638 Return type deduction for normal functions
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3638.html
71
112. ラムダ式の戻り値型推論
の変更
CWG Issue 1048. auto deduction and lambda return type deduction
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1048
112
167. メンバ初期化子と集成体
N3605 Member initializers and aggregates
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3605.html
N3653 Member initializers and aggregates
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html
167
192. 文脈依存変換の微調整
N3253 A Proposal to Tweak Certain C++ Contextual Conversions
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3253.pdf
N3306 A Proposal to Tweak Certain C++ Contextual Conversions, v2
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3306.pdf
N3323 A Proposal to Tweak Certain C++ Contextual Conversions, v3
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3323.pdf
192