CodeQL library for C/C++
codeql/cpp-all 6.1.4-dev (changelog, source)
Search

Member predicate Field::getOffsetInClass

Gets the offset (in bytes) of this field starting at c.

For example, consider:

struct S1 {
  int a;
  void* b;
};

struct S2 {
  S1 s1;
  char c;
};

If f represents the field s1 and c represents the class S2 then f.getOffsetInClass(S2) = 0 holds. Likewise, if f represents the field a, then f.getOffsetInClass(c) = 0 holds.

int getOffsetInClass(Class c)