File indexing completed on 2025-10-23 08:55:37
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_PFR_DETAIL_TIE_FROM_STRUCTURE_TUPLE_HPP
0008 #define BOOST_PFR_DETAIL_TIE_FROM_STRUCTURE_TUPLE_HPP
0009 #pragma once
0010
0011 #include <boost/pfr/detail/config.hpp>
0012
0013 #include <boost/pfr/detail/core.hpp>
0014
0015 #include <boost/pfr/detail/stdtuple.hpp>
0016 #include <boost/pfr/tuple_size.hpp>
0017 #include <boost/pfr/detail/make_integer_sequence.hpp>
0018
0019 #ifdef BOOST_PFR_HAS_STD_MODULE
0020 import std;
0021 #else
0022 #include <tuple>
0023 #endif
0024
0025 namespace boost { namespace pfr { namespace detail {
0026
0027
0028
0029
0030
0031 template <typename... Elements>
0032 struct tie_from_structure_tuple : std::tuple<Elements&...> {
0033 using base = std::tuple<Elements&...>;
0034 using base::base;
0035
0036 template <typename T>
0037 constexpr tie_from_structure_tuple& operator= (T const& t) {
0038 base::operator=(
0039 detail::make_stdtiedtuple_from_tietuple(
0040 detail::tie_as_tuple(t),
0041 detail::make_index_sequence<tuple_size_v<T>>()));
0042 return *this;
0043 }
0044 };
0045
0046 }}}
0047
0048 #endif