Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:42:25

0001 // Copyright (c) 2023 Denis Mikhailov
0002 //
0003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
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 #ifdef BOOST_PFR_HAS_STD_MODULE
0013 import std;
0014 #else
0015 #include <utility> // metaprogramming stuff
0016 #include <array>
0017 #include <type_traits> // for std::common_type_t
0018 #include <cstddef>
0019 #endif
0020 
0021 #include <boost/pfr/detail/sequence_tuple.hpp>
0022 
0023 namespace boost { namespace pfr { namespace detail {
0024 
0025 template <class... Types>
0026 constexpr auto make_stdarray(const Types&... t) noexcept {
0027     return std::array<std::common_type_t<Types...>, sizeof...(Types)>{t...};
0028 }
0029 
0030 template <class T, std::size_t... I>
0031 constexpr auto make_stdarray_from_tietuple(const T& t, std::index_sequence<I...>, int) noexcept {
0032     return detail::make_stdarray(
0033         boost::pfr::detail::sequence_tuple::get<I>(t)...
0034     );
0035 }
0036 
0037 template <class T>
0038 constexpr auto make_stdarray_from_tietuple(const T&, std::index_sequence<>, long) noexcept {
0039     return std::array<std::nullptr_t, 0>{};
0040 }
0041 
0042 }}} // namespace boost::pfr::detail
0043 
0044 #endif // BOOST_PFR_DETAIL_STDARRAY_HPP
0045