Movatterモバイル変換


[0]ホーム

URL:


Next: ,Previous: Vector Extensions,Up: C Extensions


5.46 Offsetof

GCC implements for both C and C++ a syntactic extension to implementtheoffsetof macro.

     primary:     "__builtin_offsetof" "("typename "," offsetof_member_designator ")"          offsetof_member_designator:identifier     | offsetof_member_designator "."identifier     | offsetof_member_designator "["expr "]"

This extension is sufficient such that

     #define offsetof(type,member)  __builtin_offsetof (type,member)

is a suitable definition of theoffsetof macro. In C++,typemay be dependent. In either case,member may consist of a singleidentifier, or a sequence of member accesses and array references.


[8]ページ先頭

©2009-2025 Movatter.jp