#pragma once #include #include #include #include #include #include namespace detail { template struct __nth__ { }; template struct __nth__<0, _Tp0, _Rest...> { using type = _Tp0; }; template struct __nth__<1, _Tp0, _Tp1, _Rest...> { using type = _Tp1; }; template struct __nth__<2, _Tp0, _Tp1, _Tp2, _Rest...> { using type = _Tp2; }; template struct __nth__<_Np, _Tp0, _Tp1, _Tp2, _Rest...> : __nth__<_Np - 3, _Rest...> { }; template using _Select_nth_type = typename __nth__<_Idx, _Types...>::type; template struct _Select_int_base; template struct _Select_int_base<_Val, _IntType, _Ints...> : std::conditional_t<(_Val <= std::numeric_limits<_IntType>::max()), std::integral_constant<_IntType, (_IntType)_Val>, _Select_int_base<_Val, _Ints...>> { }; template struct _Select_int_base<_Val> { }; template using _Select_int = typename _Select_int_base<_Val, unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long>::type:: value_type; } // namespace detail namespace impl::variadic { #pragma packed(push, 1) template struct _Index_base { _Index_type __this_; _Index_type __next_; constexpr _Index_base(const _Index_type __i, const _Index_type __j) noexcept : __this_{__i}, __next_{__j} {} }; #pragma packed(pop) template struct _Element : public _Index_base<_Index_type>, public no_unique_address_emulation<_Ty> { template explicit constexpr _Element(const std::size_t __i, _Args &&...__ctors) // noexcept(std::is_nothrow_constructible_v<_Ty, _Args...>) : _Index_base<_Index_type>{static_cast<_Index_type>(__i), std::numeric_limits<_Index_type>::max()}, no_unique_address_emulation<_Ty>(std::forward<_Args>(__ctors)...) { } }; template struct variadic { }; } // namespace impl::variadic