Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:44:22

0001 // Copyright (c) 2016-2025 Antony Polukhin
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_STDTUPLE_HPP
0007 #define BOOST_PFR_DETAIL_STDTUPLE_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 <tuple>
0017 #endif
0018 
0019 #include <boost/pfr/detail/sequence_tuple.hpp>
0020 
0021 namespace boost { namespace pfr { namespace detail {
0022 
0023 template <class T, std::size_t... I>
0024 constexpr auto make_stdtuple_from_tietuple(const T& t, std::index_sequence<I...>) {
0025     (void)t;  // workaround for MSVC 14.1 `warning C4100: 't': unreferenced formal parameter`
0026     return std::make_tuple(
0027         boost::pfr::detail::sequence_tuple::get<I>(t)...
0028     );
0029 }
0030 
0031 template <class T, std::size_t... I>
0032 constexpr auto make_stdtiedtuple_from_tietuple(const T& t, std::index_sequence<I...>) noexcept {
0033     (void)t;  // workaround for MSVC 14.1 `warning C4100: 't': unreferenced formal parameter`
0034     return std::tie(
0035         boost::pfr::detail::sequence_tuple::get<I>(t)...
0036     );
0037 }
0038 
0039 template <class T, std::size_t... I>
0040 constexpr auto make_conststdtiedtuple_from_tietuple(const T& t, std::index_sequence<I...>) noexcept {
0041     (void)t;  // workaround for MSVC 14.1 `warning C4100: 't': unreferenced formal parameter`
0042     return std::tuple<
0043         std::add_lvalue_reference_t<std::add_const_t<
0044             std::remove_reference_t<decltype(boost::pfr::detail::sequence_tuple::get<I>(t))>
0045         >>...
0046     >(
0047         boost::pfr::detail::sequence_tuple::get<I>(t)...
0048     );
0049 }
0050 
0051 }}} // namespace boost::pfr::detail
0052 
0053 #endif // BOOST_PFR_DETAIL_STDTUPLE_HPP