diff --git a/include/boost/pfr/detail/cast_to_layout_compatible.hpp b/include/boost/pfr/detail/cast_to_layout_compatible.hpp index 710f2ba..1ea9e83 100644 --- a/include/boost/pfr/detail/cast_to_layout_compatible.hpp +++ b/include/boost/pfr/detail/cast_to_layout_compatible.hpp @@ -11,7 +11,7 @@ #include #include // metaprogramming stuff -#include +#include namespace boost { namespace pfr { namespace detail { @@ -62,8 +62,10 @@ MAY_ALIAS To& cast_to_layout_compatible(From& val) noexcept { return *t; } +#ifdef BOOST_PFR_DETAIL_STRICT_RVALUE_TESTING template -MAY_ALIAS To&& cast_to_layout_compatible(rvalue_t val) = delete; +To&& cast_to_layout_compatible(rvalue_t val) noexcept = delete; +#endif #undef MAY_ALIAS diff --git a/include/boost/pfr/detail/core14_classic.hpp b/include/boost/pfr/detail/core14_classic.hpp index d16df59..58fb383 100644 --- a/include/boost/pfr/detail/core14_classic.hpp +++ b/include/boost/pfr/detail/core14_classic.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #ifdef __clang__ # pragma clang diagnostic push @@ -536,7 +536,7 @@ constexpr bool is_flat_refelectable(std::index_sequence) noexcept { } template -auto tie_as_flat_tuple(lvalue_t lvalue) noexcept { +auto tie_as_flat_tuple(T& lvalue) noexcept { using type = std::remove_cv_t; using tuple_type = internal_tuple_with_same_alignment_t; @@ -547,7 +547,7 @@ auto tie_as_flat_tuple(lvalue_t lvalue) noexcept { #if !BOOST_PFR_USE_CPP17 template -auto tie_as_tuple(lvalue_t val) noexcept { +auto tie_as_tuple(T& val) noexcept { typedef T type; static_assert( boost::pfr::detail::is_flat_refelectable( std::make_index_sequence()>{} ), @@ -590,10 +590,10 @@ struct is_constexpr_aggregate_initializable { // TODO: try to fix it template -void for_each_field_in_depth(lvalue_t t, F&& f, std::index_sequence, identity...); +void for_each_field_in_depth(T& t, F&& f, std::index_sequence, identity...); template -void for_each_field_in_depth(lvalue_t t, F&& f, std::index_sequence<>, identity...); +void for_each_field_in_depth(T& t, F&& f, std::index_sequence<>, identity...); template struct next_step { @@ -615,7 +615,7 @@ struct next_step { }; template -void for_each_field_in_depth(lvalue_t t, F&& f, std::index_sequence, identity...) { +void for_each_field_in_depth(T& t, F&& f, std::index_sequence, identity...) { (void)std::add_const_t>{ Fields{}..., next_step, Fields...>{t, f}, @@ -624,7 +624,7 @@ void for_each_field_in_depth(lvalue_t t, F&& f, std::index_sequence } template -void for_each_field_in_depth(lvalue_t lvalue, F&& f, std::index_sequence<>, identity...) { +void for_each_field_in_depth(T& lvalue, F&& f, std::index_sequence<>, identity...) { using tuple_type = sequence_tuple::tuple; offset_based_getter>, tuple_type> getter; @@ -634,7 +634,7 @@ void for_each_field_in_depth(lvalue_t lvalue, F&& f, std::index_sequence<>, i } template -void for_each_field_dispatcher_1(lvalue_t t, F&& f, std::index_sequence, std::true_type /*is_flat_refelectable*/) { +void for_each_field_dispatcher_1(T& t, F&& f, std::index_sequence, std::true_type /*is_flat_refelectable*/) { std::forward(f)( boost::pfr::detail::tie_as_flat_tuple(t) ); @@ -642,7 +642,7 @@ void for_each_field_dispatcher_1(lvalue_t t, F&& f, std::index_sequence template -void for_each_field_dispatcher_1(lvalue_t t, F&& f, std::index_sequence, std::false_type /*is_flat_refelectable*/) { +void for_each_field_dispatcher_1(T& t, F&& f, std::index_sequence, std::false_type /*is_flat_refelectable*/) { boost::pfr::detail::for_each_field_in_depth( t, std::forward(f), @@ -651,7 +651,7 @@ void for_each_field_dispatcher_1(lvalue_t t, F&& f, std::index_sequence } template -void for_each_field_dispatcher(lvalue_t t, F&& f, std::index_sequence) { +void for_each_field_dispatcher(T& t, F&& f, std::index_sequence) { /// Compile time error at this point means that you have called `for_each_field` or some other non-flat function or operator for a /// type that is not constexpr aggregate initializable. /// diff --git a/include/boost/pfr/detail/core14_loophole.hpp b/include/boost/pfr/detail/core14_loophole.hpp index bd09c65..7a7ad15 100644 --- a/include/boost/pfr/detail/core14_loophole.hpp +++ b/include/boost/pfr/detail/core14_loophole.hpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #ifdef __clang__ @@ -102,7 +102,7 @@ struct loophole_type_list< T, std::index_sequence > template -auto tie_as_tuple_loophole_impl(lvalue_t lvalue) noexcept { +auto tie_as_tuple_loophole_impl(T& lvalue) noexcept { using type = std::remove_cv_t>; using indexes = std::make_index_sequence()>; using tuple_type = typename loophole_type_list::type; @@ -119,14 +119,14 @@ auto tie_as_tuple_loophole_impl(lvalue_t lvalue) noexcept { template auto tie_as_tuple_recursively(rvalue_t val) noexcept; template -auto tie_or_value(lvalue_t val, std::enable_if_t >::value>* = 0) noexcept { +auto tie_or_value(T& val, std::enable_if_t >::value>* = 0) noexcept { return boost::pfr::detail::tie_as_tuple_recursively( boost::pfr::detail::tie_as_tuple_loophole_impl(val) ); } template -decltype(auto) tie_or_value(lvalue_t val, std::enable_if_t>::value>* = 0) noexcept { +decltype(auto) tie_or_value(T& val, std::enable_if_t>::value>* = 0) noexcept { // This is compatible with the pre-loophole implementation, and tests, but IIUC it violates strict aliasing unfortunately return cast_to_layout_compatible< std::underlying_type_t > @@ -139,15 +139,15 @@ decltype(auto) tie_or_value(lvalue_t val, std::enable_if_t -decltype(auto) tie_or_value(lvalue_t val, std::enable_if_t >::value && !std::is_enum< std::remove_reference_t >::value>* = 0) noexcept { +decltype(auto) tie_or_value(T& val, std::enable_if_t >::value && !std::is_enum< std::remove_reference_t >::value>* = 0) noexcept { return val; } template -auto tie_as_tuple_recursively_impl(lvalue_t tup, std::index_sequence ) noexcept +auto tie_as_tuple_recursively_impl(T& tup, std::index_sequence ) noexcept -> sequence_tuple::tuple< decltype(boost::pfr::detail::tie_or_value( - sequence_tuple::get(std::forward(tup)) + sequence_tuple::get(tup) ))... > { @@ -165,7 +165,7 @@ auto tie_as_tuple_recursively(rvalue_t tup) noexcept { } template -auto tie_as_flat_tuple(lvalue_t t) { +auto tie_as_flat_tuple(T& t) { auto rec_tuples = boost::pfr::detail::tie_as_tuple_recursively( boost::pfr::detail::tie_as_tuple_loophole_impl(t) ); @@ -178,14 +178,14 @@ auto tie_as_flat_tuple(lvalue_t t) { #if !BOOST_PFR_USE_CPP17 template -auto tie_as_tuple(lvalue_t val) noexcept { +auto tie_as_tuple(T& val) noexcept { return boost::pfr::detail::tie_as_tuple_loophole_impl( val ); } template -void for_each_field_dispatcher(lvalue_t t, F&& f, std::index_sequence) { +void for_each_field_dispatcher(T& t, F&& f, std::index_sequence) { std::forward(f)( boost::pfr::detail::tie_as_tuple_loophole_impl(t) ); diff --git a/include/boost/pfr/detail/core17.hpp b/include/boost/pfr/detail/core17.hpp index 148f78c..3c9c8d3 100644 --- a/include/boost/pfr/detail/core17.hpp +++ b/include/boost/pfr/detail/core17.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include namespace boost { namespace pfr { namespace detail { @@ -21,7 +21,8 @@ struct do_not_define_std_tuple_size_for_me { template constexpr bool do_structured_bindings_work() noexcept { // ******************************************* IN CASE OF ERROR READ THE FOLLOWING LINES IN boost/pfr/detail/core17.hpp FILE: - const auto& [a] = T{}; // ******************************************* IN CASE OF ERROR READ THE FOLLOWING LINES IN boost/pfr/detail/core17.hpp FILE: + T val{}; + const auto& [a] = val; // ******************************************* IN CASE OF ERROR READ THE FOLLOWING LINES IN boost/pfr/detail/core17.hpp FILE: /**************************************************************************** * @@ -46,7 +47,7 @@ static_assert( #endif // #ifndef _MSC_VER template -void for_each_field_dispatcher(lvalue_t t, F&& f, std::index_sequence) { +void for_each_field_dispatcher(T& t, F&& f, std::index_sequence) { std::forward(f)( detail::tie_as_tuple(t) ); diff --git a/include/boost/pfr/detail/core17_generated.hpp b/include/boost/pfr/detail/core17_generated.hpp index c51af7e..08d0f54 100644 --- a/include/boost/pfr/detail/core17_generated.hpp +++ b/include/boost/pfr/detail/core17_generated.hpp @@ -20,7 +20,6 @@ #include #include -#include namespace boost { namespace pfr { namespace detail { @@ -30,301 +29,301 @@ constexpr auto make_tuple_of_references(Args&&... args) noexcept { } template -constexpr auto tie_as_tuple(T&& /*val*/, size_t_<0>) noexcept { +constexpr auto tie_as_tuple(T& /*val*/, size_t_<0>) noexcept { return sequence_tuple::tuple<>{}; } template -constexpr auto tie_as_tuple(lvalue_t val, size_t_<1>, std::enable_if_t >::value>* = 0) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<1>, std::enable_if_t >::value>* = 0) noexcept { auto& [a] = val; return ::boost::pfr::detail::make_tuple_of_references(a); } template -constexpr auto tie_as_tuple(lvalue_t val, size_t_<1>, std::enable_if_t >::value>* = 0) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<1>, std::enable_if_t >::value>* = 0) noexcept { return ::boost::pfr::detail::make_tuple_of_references( val ); } template -constexpr auto tie_as_tuple(T&& val, size_t_<2>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<2>) noexcept { auto& [a,b] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b); } template -constexpr auto tie_as_tuple(T&& val, size_t_<3>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<3>) noexcept { auto& [a,b,c] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c); } template -constexpr auto tie_as_tuple(T&& val, size_t_<4>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<4>) noexcept { auto& [a,b,c,d] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d); } template -constexpr auto tie_as_tuple(T&& val, size_t_<5>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<5>) noexcept { auto& [a,b,c,d,e] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e); } template -constexpr auto tie_as_tuple(T&& val, size_t_<6>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<6>) noexcept { auto& [a,b,c,d,e,f] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f); } template -constexpr auto tie_as_tuple(T&& val, size_t_<7>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<7>) noexcept { auto& [a,b,c,d,e,f,g] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g); } template -constexpr auto tie_as_tuple(T&& val, size_t_<8>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<8>) noexcept { auto& [a,b,c,d,e,f,g,h] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h); } template -constexpr auto tie_as_tuple(T&& val, size_t_<9>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<9>) noexcept { auto& [a,b,c,d,e,f,g,h,j] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j); } template -constexpr auto tie_as_tuple(T&& val, size_t_<10>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<10>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k); } template -constexpr auto tie_as_tuple(T&& val, size_t_<11>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<11>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l); } template -constexpr auto tie_as_tuple(T&& val, size_t_<12>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<12>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m); } template -constexpr auto tie_as_tuple(T&& val, size_t_<13>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<13>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n); } template -constexpr auto tie_as_tuple(T&& val, size_t_<14>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<14>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p); } template -constexpr auto tie_as_tuple(T&& val, size_t_<15>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<15>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q); } template -constexpr auto tie_as_tuple(T&& val, size_t_<16>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<16>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r); } template -constexpr auto tie_as_tuple(T&& val, size_t_<17>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<17>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s); } template -constexpr auto tie_as_tuple(T&& val, size_t_<18>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<18>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t); } template -constexpr auto tie_as_tuple(T&& val, size_t_<19>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<19>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u); } template -constexpr auto tie_as_tuple(T&& val, size_t_<20>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<20>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v); } template -constexpr auto tie_as_tuple(T&& val, size_t_<21>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<21>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w); } template -constexpr auto tie_as_tuple(T&& val, size_t_<22>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<22>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x); } template -constexpr auto tie_as_tuple(T&& val, size_t_<23>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<23>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y); } template -constexpr auto tie_as_tuple(T&& val, size_t_<24>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<24>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z); } template -constexpr auto tie_as_tuple(T&& val, size_t_<25>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<25>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A); } template -constexpr auto tie_as_tuple(T&& val, size_t_<26>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<26>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B); } template -constexpr auto tie_as_tuple(T&& val, size_t_<27>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<27>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C); } template -constexpr auto tie_as_tuple(T&& val, size_t_<28>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<28>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D); } template -constexpr auto tie_as_tuple(T&& val, size_t_<29>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<29>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E); } template -constexpr auto tie_as_tuple(T&& val, size_t_<30>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<30>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F); } template -constexpr auto tie_as_tuple(T&& val, size_t_<31>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<31>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G); } template -constexpr auto tie_as_tuple(T&& val, size_t_<32>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<32>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H); } template -constexpr auto tie_as_tuple(T&& val, size_t_<33>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<33>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J); } template -constexpr auto tie_as_tuple(T&& val, size_t_<34>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<34>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K); } template -constexpr auto tie_as_tuple(T&& val, size_t_<35>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<35>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L); } template -constexpr auto tie_as_tuple(T&& val, size_t_<36>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<36>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M); } template -constexpr auto tie_as_tuple(T&& val, size_t_<37>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<37>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N); } template -constexpr auto tie_as_tuple(T&& val, size_t_<38>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<38>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P); } template -constexpr auto tie_as_tuple(T&& val, size_t_<39>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<39>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q); } template -constexpr auto tie_as_tuple(T&& val, size_t_<40>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<40>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R); } template -constexpr auto tie_as_tuple(T&& val, size_t_<41>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<41>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S); } template -constexpr auto tie_as_tuple(T&& val, size_t_<42>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<42>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U); } template -constexpr auto tie_as_tuple(T&& val, size_t_<43>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<43>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V); } template -constexpr auto tie_as_tuple(T&& val, size_t_<44>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<44>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W); } template -constexpr auto tie_as_tuple(T&& val, size_t_<45>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<45>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X); } template -constexpr auto tie_as_tuple(T&& val, size_t_<46>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<46>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y); } template -constexpr auto tie_as_tuple(T&& val, size_t_<47>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<47>) noexcept { auto& [a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z] = val; return ::boost::pfr::detail::make_tuple_of_references(a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z); } template -constexpr auto tie_as_tuple(T&& val, size_t_<48>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<48>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa @@ -337,7 +336,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<48>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<49>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<49>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab @@ -350,7 +349,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<49>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<50>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<50>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac @@ -363,7 +362,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<50>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<51>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<51>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad @@ -376,7 +375,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<51>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<52>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<52>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae @@ -389,7 +388,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<52>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<53>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<53>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af @@ -402,7 +401,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<53>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<54>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<54>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag @@ -415,7 +414,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<54>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<55>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<55>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah @@ -428,7 +427,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<55>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<56>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<56>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj @@ -441,7 +440,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<56>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<57>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<57>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak @@ -454,7 +453,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<57>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<58>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<58>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al @@ -467,7 +466,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<58>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<59>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<59>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am @@ -480,7 +479,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<59>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<60>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<60>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an @@ -493,7 +492,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<60>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<61>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<61>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap @@ -506,7 +505,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<61>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<62>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<62>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq @@ -519,7 +518,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<62>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<63>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<63>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar @@ -532,7 +531,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<63>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<64>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<64>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as @@ -545,7 +544,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<64>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<65>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<65>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at @@ -558,7 +557,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<65>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<66>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<66>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au @@ -571,7 +570,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<66>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<67>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<67>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av @@ -584,7 +583,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<67>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<68>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<68>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw @@ -597,7 +596,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<68>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<69>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<69>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax @@ -610,7 +609,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<69>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<70>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<70>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay @@ -623,7 +622,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<70>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<71>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<71>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az @@ -636,7 +635,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<71>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<72>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<72>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA @@ -649,7 +648,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<72>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<73>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<73>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB @@ -662,7 +661,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<73>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<74>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<74>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC @@ -675,7 +674,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<74>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<75>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<75>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD @@ -688,7 +687,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<75>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<76>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<76>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE @@ -701,7 +700,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<76>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<77>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<77>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF @@ -714,7 +713,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<77>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<78>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<78>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG @@ -727,7 +726,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<78>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<79>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<79>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH @@ -740,7 +739,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<79>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<80>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<80>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ @@ -753,7 +752,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<80>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<81>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<81>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK @@ -766,7 +765,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<81>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<82>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<82>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL @@ -779,7 +778,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<82>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<83>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<83>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM @@ -792,7 +791,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<83>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<84>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<84>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN @@ -805,7 +804,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<84>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<85>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<85>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP @@ -818,7 +817,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<85>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<86>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<86>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ @@ -831,7 +830,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<86>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<87>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<87>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR @@ -844,7 +843,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<87>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<88>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<88>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS @@ -857,7 +856,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<88>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<89>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<89>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU @@ -870,7 +869,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<89>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<90>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<90>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV @@ -883,7 +882,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<90>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<91>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<91>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW @@ -896,7 +895,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<91>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<92>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<92>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX @@ -909,7 +908,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<92>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<93>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<93>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX,aY @@ -922,7 +921,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<93>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<94>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<94>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX,aY,aZ @@ -935,7 +934,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<94>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<95>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<95>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX,aY,aZ, @@ -950,7 +949,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<95>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<96>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<96>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX,aY,aZ, @@ -965,7 +964,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<96>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<97>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<97>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX,aY,aZ, @@ -980,7 +979,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<97>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<98>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<98>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX,aY,aZ, @@ -995,7 +994,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<98>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<99>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<99>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX,aY,aZ, @@ -1010,7 +1009,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<99>) noexcept { } template -constexpr auto tie_as_tuple(T&& val, size_t_<100>) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<100>) noexcept { auto& [ a,b,c,d,e,f,g,h,j,k,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,U,V,W,X,Y,Z, aa,ab,ac,ad,ae,af,ag,ah,aj,ak,al,am,an,ap,aq,ar,as,at,au,av,aw,ax,ay,az,aA,aB,aC,aD,aE,aF,aG,aH,aJ,aK,aL,aM,aN,aP,aQ,aR,aS,aU,aV,aW,aX,aY,aZ, @@ -1028,7 +1027,7 @@ constexpr auto tie_as_tuple(T&& val, size_t_<100>) noexcept { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -constexpr auto tie_as_tuple(lvalue_t val) noexcept { +constexpr auto tie_as_tuple(T& val) noexcept { typedef size_t_()> fields_count_tag; return boost::pfr::detail::tie_as_tuple(val, fields_count_tag{}); } diff --git a/include/boost/pfr/detail/for_each_field_impl.hpp b/include/boost/pfr/detail/for_each_field_impl.hpp index 6dd2829..2b8027c 100644 --- a/include/boost/pfr/detail/for_each_field_impl.hpp +++ b/include/boost/pfr/detail/for_each_field_impl.hpp @@ -12,7 +12,7 @@ #include // metaprogramming stuff #include -#include +#include namespace boost { namespace pfr { namespace detail { @@ -30,7 +30,7 @@ void for_each_field_impl_apply(T&& v, F&& f, I /*i*/, int) { } template -void for_each_field_impl(lvalue_t t, F&& f, std::index_sequence, std::false_type /*move_values*/) { +void for_each_field_impl(T& t, F&& f, std::index_sequence, std::false_type /*move_values*/) { const int v[] = {( for_each_field_impl_apply(sequence_tuple::get(t), std::forward(f), size_t_{}, 1L), 0 @@ -40,7 +40,7 @@ void for_each_field_impl(lvalue_t t, F&& f, std::index_sequence, std::f template -void for_each_field_impl(lvalue_t t, F&& f, std::index_sequence, std::true_type /*move_values*/) { +void for_each_field_impl(T& t, F&& f, std::index_sequence, std::true_type /*move_values*/) { const int v[] = {( for_each_field_impl_apply(sequence_tuple::get(std::move(t)), std::forward(f), size_t_{}, 1L), 0 diff --git a/include/boost/pfr/detail/io.hpp b/include/boost/pfr/detail/io.hpp index 067e74a..d49372a 100644 --- a/include/boost/pfr/detail/io.hpp +++ b/include/boost/pfr/detail/io.hpp @@ -46,13 +46,6 @@ struct print_impl { out << quoted_helper(boost::pfr::detail::sequence_tuple::get(value)); print_impl::print(out, value); } - - template - static void print (Stream& out, const std::string& value) { - if (!!I) out << ", "; - out << std::quoted( boost::pfr::detail::sequence_tuple::get(value) ); - print_impl::print(out, value); - } }; template diff --git a/include/boost/pfr/detail/lr_value.hpp b/include/boost/pfr/detail/lr_value.hpp deleted file mode 100644 index b535f67..0000000 --- a/include/boost/pfr/detail/lr_value.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2016-2017 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_LR_VALUE_HPP -#define BOOST_PFR_DETAIL_LR_VALUE_HPP -#pragma once - -// This header provides aliases rvalue_t and lvalue_t. -// -// Usage: template void foo(lvalue_t lvalue_possible_cv_qualified); -// -// Those are useful for -// * better type safety - you can validate at compile time that only l/rvalue reference is passed into the function -// * documentation and readability - lvalue_t is much better than T&& or T&&+SFINAE - -namespace boost { namespace pfr { namespace detail { - -/// Binds to rvalues -template using rvalue_t = T&&; - -/// Binds to const and non-const lvalues -template using lvalue_t = T&; - -}}} // namespace boost::pfr::detail - -#endif // BOOST_PFR_DETAIL_CONFIG_HPP diff --git a/include/boost/pfr/detail/make_flat_tuple_of_references.hpp b/include/boost/pfr/detail/make_flat_tuple_of_references.hpp index e2874b3..df2a7b8 100644 --- a/include/boost/pfr/detail/make_flat_tuple_of_references.hpp +++ b/include/boost/pfr/detail/make_flat_tuple_of_references.hpp @@ -11,7 +11,7 @@ #include // metaprogramming stuff #include -#include +#include namespace boost { namespace pfr { namespace detail { @@ -22,24 +22,24 @@ using size_t_ = std::integral_constant; // Helper: Make a "getter" object corresponding to built-in tuple::get // For user-defined structures, the getter should be "offset_based_getter" struct sequence_tuple_getter { - template - decltype(auto) get(lvalue_t t, size_t_) const noexcept { + template + decltype(auto) get(const TupleOfReferences& t, size_t_) const noexcept { return sequence_tuple::get(t); }; }; -template -constexpr auto make_flat_tuple_of_references(lvalue_t, const Getter&, size_t_, size_t_) noexcept; +template +constexpr auto make_flat_tuple_of_references(TupleOrUserType&, const Getter&, size_t_, size_t_) noexcept; -template -constexpr sequence_tuple::tuple<> make_flat_tuple_of_references(lvalue_t, const Getter&, size_t_, size_t_<0>) noexcept; +template +constexpr sequence_tuple::tuple<> make_flat_tuple_of_references(TupleOrUserType&, const Getter&, size_t_, size_t_<0>) noexcept; -template -constexpr auto make_flat_tuple_of_references(lvalue_t, const Getter&, size_t_, size_t_<1>) noexcept; +template +constexpr auto make_flat_tuple_of_references(TupleOrUserType&, const Getter&, size_t_, size_t_<1>) noexcept; template -constexpr auto tie_as_tuple_with_references(lvalue_t... args) noexcept { +constexpr auto tie_as_tuple_with_references(T&... args) noexcept { return sequence_tuple::tuple{ args... }; } @@ -69,8 +69,8 @@ constexpr auto my_tuple_cat(const Tuple1& t1, const Tuple2& t2) noexcept { ); } -template -constexpr auto make_flat_tuple_of_references(lvalue_t t, const Getter& g, size_t_, size_t_) noexcept { +template +constexpr auto make_flat_tuple_of_references(TupleOrUserType& t, const Getter& g, size_t_, size_t_) noexcept { constexpr std::size_t next_size = Size / 2; return my_tuple_cat( make_flat_tuple_of_references(t, g, size_t_{}, size_t_{}), @@ -78,13 +78,13 @@ constexpr auto make_flat_tuple_of_references(lvalue_t t, const Getter& g, ); } -template -constexpr sequence_tuple::tuple<> make_flat_tuple_of_references(lvalue_t, const Getter&, size_t_, size_t_<0>) noexcept { +template +constexpr sequence_tuple::tuple<> make_flat_tuple_of_references(TupleOrUserType&, const Getter&, size_t_, size_t_<0>) noexcept { return {}; } -template -constexpr auto make_flat_tuple_of_references(lvalue_t t, const Getter& g, size_t_, size_t_<1>) noexcept { +template +constexpr auto make_flat_tuple_of_references(TupleOrUserType& t, const Getter& g, size_t_, size_t_<1>) noexcept { return tie_as_tuple_with_references( g.get(t, size_t_{}) ); diff --git a/include/boost/pfr/detail/offset_based_getter.hpp b/include/boost/pfr/detail/offset_based_getter.hpp index 185ea7d..7529542 100644 --- a/include/boost/pfr/detail/offset_based_getter.hpp +++ b/include/boost/pfr/detail/offset_based_getter.hpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include namespace boost { namespace pfr { namespace detail { diff --git a/include/boost/pfr/detail/rvalue_t.hpp b/include/boost/pfr/detail/rvalue_t.hpp new file mode 100644 index 0000000..c1b37e6 --- /dev/null +++ b/include/boost/pfr/detail/rvalue_t.hpp @@ -0,0 +1,35 @@ +// Copyright (c) 2016-2017 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_RVALUE_T_HPP +#define BOOST_PFR_DETAIL_RVALUE_T_HPP +#pragma once + +#include +#include // std::enable_if_t + +// This header provides aliases rvalue_t and lvalue_t. +// +// Usage: template void foo(rvalue rvalue); +// +// Those are useful for +// * better type safety - you can validate at compile time that only rvalue reference is passed into the function +// * documentation and readability - rvalue_t is much better than T&&+SFINAE + +namespace boost { namespace pfr { namespace detail { + +/// Binds to rvalues only, no copying allowed. +template ::value> +#endif +> +using rvalue_t = T&&; + +/// Binds to mutable lvalues only + +}}} // namespace boost::pfr::detail + +#endif // BOOST_PFR_DETAIL_RVALUE_T_HPP diff --git a/include/boost/pfr/detail/sequence_tuple.hpp b/include/boost/pfr/detail/sequence_tuple.hpp index 7040b31..f869c07 100644 --- a/include/boost/pfr/detail/sequence_tuple.hpp +++ b/include/boost/pfr/detail/sequence_tuple.hpp @@ -115,9 +115,6 @@ constexpr decltype(auto) get(tuple&& t) noexcept { return get_impl(std::move(t)); } -// TODO: Shouldn't this be std::remove_reference_t ?? -// Or better, implemented using variadic templates to extract I'th parameter -// exactly? template using tuple_element = std::remove_reference< decltype( ::boost::pfr::detail::sequence_tuple::get( std::declval() ) diff --git a/include/boost/pfr/flat/io.hpp b/include/boost/pfr/flat/io.hpp index d32d4f7..93d84da 100644 --- a/include/boost/pfr/flat/io.hpp +++ b/include/boost/pfr/flat/io.hpp @@ -59,7 +59,9 @@ void flat_read(std::basic_istream& in, T& value) { char parenthis = {}; in >> parenthis; if (parenthis != '{') in.setstate(std::basic_istream::failbit); - detail::read_impl<0, flat_tuple_size_v >::read(in, detail::tie_as_flat_tuple(value)); + + auto tuple = detail::tie_as_flat_tuple(value); + detail::read_impl<0, flat_tuple_size_v >::read(in, tuple); in >> parenthis; if (parenthis != '}') in.setstate(std::basic_istream::failbit); diff --git a/misc/generate_cpp17.py b/misc/generate_cpp17.py index 10d9369..279e6d2 100644 --- a/misc/generate_cpp17.py +++ b/misc/generate_cpp17.py @@ -35,7 +35,6 @@ PROLOGUE = """// Copyright (c) 2016-2017 Antony Polukhin #include #include -#include namespace boost { namespace pfr { namespace detail { @@ -45,19 +44,19 @@ constexpr auto make_tuple_of_references(Args&&... args) noexcept { } template -constexpr auto tie_as_tuple(T&& /*val*/, size_t_<0>) noexcept { +constexpr auto tie_as_tuple(T& /*val*/, size_t_<0>) noexcept { return sequence_tuple::tuple<>{}; } template -constexpr auto tie_as_tuple(lvalue_t val, size_t_<1>, std::enable_if_t >::value>* = 0) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<1>, std::enable_if_t >::value>* = 0) noexcept { auto& [a] = val; return ::boost::pfr::detail::make_tuple_of_references(a); } template -constexpr auto tie_as_tuple(lvalue_t val, size_t_<1>, std::enable_if_t >::value>* = 0) noexcept { +constexpr auto tie_as_tuple(T& val, size_t_<1>, std::enable_if_t >::value>* = 0) noexcept { return ::boost::pfr::detail::make_tuple_of_references( val ); } @@ -68,7 +67,7 @@ EPILOGUE = """ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template -constexpr auto tie_as_tuple(lvalue_t val) noexcept { +constexpr auto tie_as_tuple(T& val) noexcept { typedef size_t_()> fields_count_tag; return boost::pfr::detail::tie_as_tuple(val, fields_count_tag{}); } @@ -85,7 +84,7 @@ generate_sfinae_attempts = False if generate_sfinae_attempts: print """ template - constexpr auto tie_as_tuple(lvalue_t val, size_t_) noexcept { + constexpr auto tie_as_tuple(T& val, size_t_) noexcept { return tie_as_tuple(val, size_t_{}); } """ @@ -106,7 +105,7 @@ for i in xrange(1, funcs_count): indexes += ascii_letters[i % max_args_on_a_line] print "template " - print "constexpr auto tie_as_tuple(T&& val, size_t_<" + str(i + 1) + ">) noexcept {" + print "constexpr auto tie_as_tuple(T& val, size_t_<" + str(i + 1) + ">) noexcept {" if i < max_args_on_a_line: print " auto& [" + indexes.strip() + "] = val;" print " return ::boost::pfr::detail::make_tuple_of_references(" + indexes.strip() + ");" @@ -123,7 +122,7 @@ for i in xrange(1, funcs_count): if generate_sfinae_attempts: print "template " - print "constexpr auto tie_as_tuple(T&& val, size_t_<" + str(i + 1) + "> v) noexcept" + print "constexpr auto tie_as_tuple(T& val, size_t_<" + str(i + 1) + "> v) noexcept" print " ->decltype( ::boost::pfr::detail::tie_as_tuple0(std::forward(val), v) )" print "{ return ::boost::pfr::detail::tie_as_tuple0(std::forward(val), v); }\n"