주요 콘텐츠

Cpp.FoldExpression Class

Namespace: Cpp
Superclasses: AstNodeProperties

Represents the fold_expression nodes in the syntax tree of your code

Since R2026a

Description

The PQL class Cpp.FoldExpression represents the node fold_expression in the syntax tree of your code.

template<typename... Args>
auto sum(Args... args) {
    return (... + args); //fold_expression

template<typename... Args>
auto sum_with_init(Args... args) {
    return (0 + ... + args); //fold_expression
}

template<typename... Args>
auto sum_right(Args... args) {
    return (args + ... + 42); //fold_expression
}

The three return statements contain fold_expression nodes. Each corresponds to a Cpp.FoldExpression in PQL.

Predicates

expand all

Version History

Introduced in R2026a