File indexing completed on 2025-01-18 09:43:38
0001
0002
0003
0004
0005
0006 #ifndef BOOST_PFR_DETAIL_STDARRAY_HPP
0007 #define BOOST_PFR_DETAIL_STDARRAY_HPP
0008 #pragma once
0009
0010 #include <boost/pfr/detail/config.hpp>
0011
0012 #include <utility> // metaprogramming stuff
0013 #include <array>
0014 #include <type_traits> // for std::common_type_t
0015 #include <cstddef>
0016
0017 #include <boost/pfr/detail/sequence_tuple.hpp>
0018
0019 namespace boost { namespace pfr { namespace detail {
0020
0021 template <class... Types>
0022 constexpr auto make_stdarray(const Types&... t) noexcept {
0023 return std::array<std::common_type_t<Types...>, sizeof...(Types)>{t...};
0024 }
0025
0026 template <class T, std::size_t... I>
0027 constexpr auto make_stdarray_from_tietuple(const T& t, std::index_sequence<I...>, int) noexcept {
0028 return detail::make_stdarray(
0029 boost::pfr::detail::sequence_tuple::get<I>(t)...
0030 );
0031 }
0032
0033 template <class T>
0034 constexpr auto make_stdarray_from_tietuple(const T&, std::index_sequence<>, long) noexcept {
0035 return std::array<std::nullptr_t, 0>{};
0036 }
0037
0038 }}}
0039
0040 #endif
0041