Namespaces
Variants

std::meta::member_offset

From cppreference.com
< cpp | meta
 
 
 
Reflection library
 
Reflection types and queries
Reflection queries
Reflection layout queries
Type properties
Type property queries
 
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 name Definition
bytes represents the offset in bytes
bits represents the remaining bits in the offset

Member functions

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

Example

See also

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