주요 콘텐츠

Cpp.CastExpression Class

Namespace: Cpp
Superclasses: AstNodeProperties

Represents the cast_expression nodes in the syntax tree of your code

Since R2026a

Description

The PQL class CastExpression represents the node cast_expression in the syntax tree of your code.

#include <iostream>

void test() {
  int a = (int)3.14;
  float b = (float)a;
  char c = (char)42;
  double d = (double)(a + b);
  std::cout << a << ' ' << b << ' ' << c << ' ' << d << '\n';
}

int main() {
  test();
  return 0;
}

The C++ demo contains several C-style cast expressions like (int)3.14 and (double)(a + b), which correspond to cast_expression nodes matched by the CastExpression PQL class.

Predicates

expand all

Version History

Introduced in R2026a