Spec-Zone.ru › C++

std::meta::member_offset

Defined in header <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;
};
(since C++26)

The type member_offset represents the offset of a member or base class relative to its enclosing class.

Data members

Member definition Description
std::ptrdiff_t bytes represents the offset in bytes
(public member object)
std::ptrdiff_t bits represents the remaining bits in the offset
(public member object)

Member functions

total_bits
returns bytes * CHAR_BIT + bits
(public member function)
operator<=>
the comparison is defaulted
(public member function)

Example

See also

offset_of
(C++26)
returns the offset of a (member or base) subobject relative to its enclosing class
(function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/member_offset

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API