Contenuto principale

Cpp.ForRangeLoop Class

Namespace: Cpp
Superclasses: AstNodeProperties

Represents the for_range_loop nodes in the syntax tree of your code

Since R2026a

Description

The PQL class Cpp.ForRangeLoop represents the node for_range_loop in the syntax tree of your code.

#include <vector>
void process(int);

void test() {
    std::vector<int> xs;
    for (auto x : xs) { process(x); }        // for_range_loop node
    for (const auto &y : xs) { }             // for_range_loop node with declarator and type qualifiers
}

The two for (...) : ... { } statements are for_range_loop nodes and correspond to this class.

Predicates

expand all

Version History

Introduced in R2026a