We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 550c9ab commit 8ef634bCopy full SHA for 8ef634b
021-cpp17-core-constexpr-lambda.md
@@ -43,6 +43,28 @@ int main()
43
}
44
~~~
45
46
+以下の内容は上級者向けの解説であり、通常の読者は理解する必要がない。
47
+
48
+constexprラムダ式はSFINAEの文脈で使うことができない。
49
50
+~~~c++
51
+// エラー
52
+template < typename T,
53
+ bool b = []{
54
+ T t ;
55
+ t.func() ;
56
+ return true ;
57
+ }() ; >
58
+void f()
59
+{
60
61
62
+}
63
+~~~
64
65
+なぜならば、これを許してしまうとテンプレート仮引数に対して任意の式や文がテンプレートのSubstitutionに失敗するかどうかをチェックできてしまうからだ。
66
67
+上級者向けの解説終わり。
68
69
機能テストマクロは__cpp_constexpr, 値は201603。
70
0 commit comments