1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef BOOST_PFR_DETAIL_TIE_FROM_STRUCTURE_TUPLE_HPP
- #define BOOST_PFR_DETAIL_TIE_FROM_STRUCTURE_TUPLE_HPP
- #pragma once
- #include <boost/pfr/detail/config.hpp>
- #include <boost/pfr/detail/core.hpp>
- #include <boost/pfr/detail/stdtuple.hpp>
- #include <boost/pfr/tuple_size.hpp>
- #include <boost/pfr/detail/make_integer_sequence.hpp>
- #include <tuple>
- namespace boost { namespace pfr { namespace detail {
- template <typename... Elements>
- struct tie_from_structure_tuple : std::tuple<Elements&...> {
- using base = std::tuple<Elements&...>;
- using base::base;
- template <typename T>
- 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<tuple_size_v<T>>()));
- return *this;
- }
- };
- }}}
- #endif
|