Namespaces
Variants

std::meta::member_offset

From cppreference.com
< cpp | meta
 
 
 
Reflection library
 
Reflection types and 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 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

(C++26)
returns the offset of a (member or base) subobject relative to its enclosing class
(function) [edit]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.