#ifndef SPROUT_TUPLE_TRAITS_HPP #define SPROUT_TUPLE_TRAITS_HPP #include #include #include #include #include #include namespace sprout { namespace types { // // rebind_types // template struct rebind_types > { public: template struct apply { public: typedef sprout::tuples::tuple type; }; }; } // namespace types using sprout::types::rebind_types; } // namespace sprout namespace sprout { namespace tuples { // // rebind_types // template struct rebind_types : public sprout::types::rebind_types {}; // // tuple_construct_traits // template struct tuple_construct_traits; namespace detail { template struct default_copied; template struct default_copied > : public sprout::tuples::rebind_types::template apply< typename std::decay< typename sprout::tuples::tuple_element::type >::type... > {}; template SPROUT_CONSTEXPR typename sprout::tuples::tuple_construct_traits::copied_type default_make_tuple(Args&&... args) { typedef typename sprout::tuples::tuple_construct_traits::copied_type copied_type; return copied_type(sprout::forward(args)...); } } // namespace detail template struct tuple_construct_traits { public: typedef typename sprout::tuples::detail::default_copied< Tuple, typename sprout::tuple_indexes::type >::type copied_type; public: template static SPROUT_CONSTEXPR copied_type deep_copy(Tup&& tup) { return sprout::forward(tup); } template static SPROUT_CONSTEXPR copied_type make(Args&&... args) { return sprout::tuples::detail::default_make_tuple(sprout::forward(args)...); } template static SPROUT_CONSTEXPR copied_type remake( Tup&&, Args&&... args ) { return make(sprout::forward(args)...); } }; template struct tuple_construct_traits : public sprout::tuples::tuple_construct_traits {}; } // namespace tuples using sprout::tuples::tuple_construct_traits; } // namespace sprout #endif // #ifndef SPROUT_TUPLE_TRAITS_HPP