// Copyright (c) 2018 Adam Butcher, Antony Polukhin // Copyright (c) 2019-2022 Antony Polukhin // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PFR_DETAIL_TIE_FROM_STRUCTURE_TUPLE_HPP #define BOOST_PFR_DETAIL_TIE_FROM_STRUCTURE_TUPLE_HPP #pragma once #include #include #include #include #include #include namespace boost { namespace pfr { namespace detail { /// \brief A `std::tuple` capable of de-structuring assignment used to support /// a tie of multiple lvalue references to fields of an aggregate T. /// /// \sa boost::pfr::tie_from_structure template struct tie_from_structure_tuple : std::tuple { using base = std::tuple; using base::base; template constexpr tie_from_structure_tuple& operator= (T const& t) { base::operator=( detail::make_stdtiedtuple_from_tietuple( detail::tie_as_tuple(t), detail::make_index_sequence>())); return *this; } }; }}} // namespace boost::pfr::detail #endif // BOOST_PFR_DETAIL_TIE_FROM_STRUCTURE_TUPLE_HPP