Skip to content

Commit

Permalink
offsetof : バージョン間の差異などについて追記
Browse files Browse the repository at this point in the history
  • Loading branch information
onihusube committed Nov 20, 2023
1 parent beb148e commit 7b90cfd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reference/cstddef/offsetof.md
Expand Up @@ -12,8 +12,9 @@
この構造体の先頭から `member` へのバイト数が、`size_t` 型の符号なし整数値で返される。
C++ での構造体の機能的拡張のため、`offsetof` の利用は、C の構造体のコンセプトに対応する POD のクラス型に制限される(但し、`public` な非仮想メンバ関数のみを持ち、コンストラクタ及びデストラクタを持たない非派生クラスも POD である)。
C++ での構造体の機能的拡張のため、`offsetof` の利用は、C++11以降は[スタンダードレイアウト](/reference/type_traits/is_standard_layout.md)のクラス型に制限され、C++11まではC の構造体のコンセプトに対応する POD のクラス型に制限される(但し、`public` な非仮想メンバ関数のみを持ち、コンストラクタ及びデストラクタを持たない非派生クラスも POD である)。
スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++14までは未定義)。
## パラメータ
- `type` : `member` を有効なメンバ指示子とするクラス型
Expand Down

0 comments on commit 7b90cfd

Please sign in to comment.