24#ifndef STELLARLIB_EXT_TYPE_TRAITS_HPP
25#define STELLARLIB_EXT_TYPE_TRAITS_HPP
42template <
typename Pack,
typename T>
50template <
typename Pack, auto VALUE>
51static constexpr auto expand_as_v{VALUE};
58using is_trivially_relocatable = std::bool_constant<std::is_trivially_move_constructible_v<T> && std::is_trivially_destructible_v<T>>;
72template <
typename AlignTo,
typename ...Fields>
78 static constexpr std::size_t
size{(
alignof(AlignTo) - (
sizeof(Fields) + ...) %
alignof(AlignTo)) %
alignof(AlignTo)};
83 [[no_unique_address]] std::conditional_t<static_cast<bool>(
size), std::array<std::byte, size>, std::tuple<>>
bytes;
Standard library extensions.
Definition bit.hpp:33
T expand_as
Expands a parameter pack into a repeated type.
Definition type_traits.hpp:43
std::bool_constant< std::is_trivially_move_constructible_v< T > &&std::is_trivially_destructible_v< T > > is_trivially_relocatable
Evaluates whether T is eligible for bit-wise relocation.
Definition type_traits.hpp:58
constexpr bool is_trivially_relocatable_v
Evaluates whether T is eligible for bit-wise relocation.
Definition type_traits.hpp:65
Compile-time padding for explicit field layout alignment.
Definition type_traits.hpp:74
std::conditional_t< static_cast< bool >(size), std::array< std::byte, size >, std::tuple<> > bytes
Padding bytes.
Definition type_traits.hpp:83
static constexpr std::size_t size
Size of the padding in bytes.
Definition type_traits.hpp:78