File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
cpp/ql/src/semmle/code/cpp/exprs Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,13 @@ import semmle.code.cpp.exprs.Expr
22import semmle.code.cpp.Class
33
44/**
5- * A C++11 lambda expression, such as `[&, =y](int x) mutable -> double {return z = (y += x);}`.
5+ * A C++11 lambda expression, for example the expression initializing `a` in
6+ * the following code:
7+ * ```
8+ * auto a = [x, y](int z) -> int {
9+ * return x + y + z;
10+ * };
11+ * ```
612 *
713 * The type given by `getType()` will be an instance of `Closure`.
814 */
@@ -71,6 +77,12 @@ class LambdaExpression extends Expr, @lambdaexpr {
7177
7278/**
7379 * A class written by the compiler to be the type of a C++11 lambda expression.
80+ * For example the variable `a` in the following code has a closure type:
81+ * ```
82+ * auto a = [x, y](int z) -> int {
83+ * return x + y + z;
84+ * };
85+ * ```
7486 */
7587class Closure extends Class {
7688 Closure ( ) {
@@ -96,7 +108,13 @@ class Closure extends Class {
96108}
97109
98110/**
99- * Information about a value captured as part of a lambda expression.
111+ * Information about a value captured as part of a lambda expression. For
112+ * example in the following code, information about `x` and `y` is captured:
113+ * ```
114+ * auto a = [x, y](int z) -> int {
115+ * return x + y + z;
116+ * };
117+ * ```
100118 */
101119class LambdaCapture extends @lambdacapture {
102120 string toString ( ) {
You can’t perform that action at this time.
0 commit comments