主要内容

Cpp.LambdaExpression Class

Namespace: Cpp
Superclasses: AstNodeProperties

Represents the lambda_expression nodes in the syntax tree of your code

Since R2026a

Description

The PQL class Cpp.LambdaExpression represents the node lambda_expression in the syntax tree of your code.

#include <functional>

int main() {
    auto l1 = []() { return 42; };
    auto l2 = [x, &y]() { return x + y; };
    auto l3 = []<typename T>(T x) { return x; };
    auto l4 = []() requires true { return 0; };
    auto l5 = [](int x) mutable -> int { return x; };
    (void)l1; (void)l2; (void)l3; (void)l4; (void)l5;
}

The code declares several lambda expressions; each lambda corresponds to a lambda_expression node that Cpp.LambdaExpression models.

Predicates

expand all

Version History

Introduced in R2026a