/*============================================================================= Copyright (c) 2011-2014 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout 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 SPROUT_TUPLE_TUPLE_TUPLE_HPP #define SPROUT_TUPLE_TUPLE_TUPLE_HPP #include #include #include #include #include namespace sprout { namespace tuples { // // tuple // // tuple construction template template< typename UType1, typename UType2, typename > inline SPROUT_CONSTEXPR sprout::tuples::tuple::tuple(sprout::pair const& t) : impl_type(t.first, t.second) {} template template< typename UType1, typename UType2, typename > inline SPROUT_CONSTEXPR sprout::tuples::tuple::tuple(sprout::pair&& t) : impl_type(SPROUT_FORWARD(UType1, t.first), SPROUT_FORWARD(UType2, t.second)) {} template template< typename UType1, typename UType2, typename > inline SPROUT_CONSTEXPR sprout::tuples::tuple::tuple(sprout::tuples::flexibly_construct_t, sprout::pair const& t) : impl_type(t.first, t.second) {} template template< typename UType1, typename UType2, typename > inline SPROUT_CONSTEXPR sprout::tuples::tuple::tuple(sprout::tuples::flexibly_construct_t, sprout::pair&& t) : impl_type(SPROUT_FORWARD(UType1, t.first), SPROUT_FORWARD(UType2, t.second)) {} // tuple assignment template template< typename UType1, typename UType2, typename > inline SPROUT_CXX14_CONSTEXPR sprout::tuples::tuple& sprout::tuples::tuple::operator=(sprout::pair const& rhs) { sprout::tuples::detail::tuple_impl<0, Types...>::head(*this) = rhs.first; sprout::tuples::detail::tuple_impl<1, Types...>::head(*this) = rhs.second; return *this; } template template< typename UType1, typename UType2, typename > inline SPROUT_CXX14_CONSTEXPR sprout::tuples::tuple& sprout::tuples::tuple::operator=(sprout::pair&& rhs) { sprout::tuples::detail::tuple_impl<0, Types...>::head(*this) = sprout::move(rhs.first); sprout::tuples::detail::tuple_impl<1, Types...>::head(*this) = sprout::move(rhs.second); return *this; } } // namespace tuples } // namespace sprout #endif // #ifndef SPROUT_TUPLE_TUPLE_TUPLE_HPP