std::meta::member_offset
来自cppreference.com
| 在标头 <meta> 定义
|
||
struct member_offset {
std::ptrdiff_t bytes;
std::ptrdiff_t bits;
constexpr std::ptrdiff_t total_bits() const;
auto operator<=>(const member_offset&) const = default;
};
|
(C++26 起) | |
类型 member_offset 表示成员或基类相对于其外围类的偏移量。
| 成员名 | 定义 |
bytes
|
表示以字节为单位的偏移量 |
bits
|
表示偏移量中剩余的位数 |
total_bits |
返回 bytes * CHAR_BITS + bits (公开成员函数) |
operator<=> |
比较运算符为预置的 (公开成员函数) |
| 本节未完成 原因:暂无示例 |
(C++26) |
返回(成员或基类)子对象相对于其外围类的偏移量 (函数) [编辑] |