Main Content

Cpp.ConditionalExpression Class

Namespace: Cpp
Superclasses: AstNodeProperties

Represents the conditional_expression nodes in the syntax tree of your code

Since R2026a

Description

The PQL class ConditionalExpression represents the node conditional_expression in the syntax tree of your code.

// example.cpp
int f(int a, int b, int c, bool flag) {
  int x = a ? b : c;
  int y = (flag ? 1 : 0) + 2;
  return x + y;
}

The code contains two conditional_expression nodes: a ? b : c and flag ? 1 : 0, which correspond to the PQL ConditionalExpression node.

Predicates

expand all

Version History

Introduced in R2026a