주요 콘텐츠

Cpp.OffsetofExpression Class

Namespace: Cpp
Superclasses: AstNodeProperties

Represents the offsetof_expression nodes in the syntax tree of your code

Since R2026a

Description

The PQL class Cpp.OffsetofExpression represents the node offsetof_expression in the syntax tree of your code. It models an offsetof(type, member) expression in C/C++.

#include <cstddef>

struct MyStruct {
  int field;
  double anotherField;
};

void foo() {
  std::size_t offset1 = offsetof(MyStruct, field);
  std::size_t offset2 = offsetof(MyStruct, anotherField);
}

The two offsetof(MyStruct, ...) expressions in foo correspond to offsetof_expression nodes and are the nodes matched by Cpp.OffsetofExpression class.

Predicates

expand all

Version History

Introduced in R2026a