/*============================================================================= Copyright (c) 2011-2016 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_UTILITY_PAIR_PAIR_HPP #define SPROUT_UTILITY_PAIR_PAIR_HPP #include #include #include #include #include #include #include #include namespace sprout { // // pair // template template inline SPROUT_CONSTEXPR sprout::pair::pair( sprout::tuples::tuple first_args, sprout::tuples::tuple second_args, sprout::index_tuple, sprout::index_tuple ) : first(sprout::tuples::get(first_args)...) , second(sprout::tuples::get(second_args)...) {} #if SPROUT_USE_DELEGATING_CONSTRUCTORS template template< typename... Args1, typename... Args2, typename > inline SPROUT_CONSTEXPR sprout::pair::pair( std::piecewise_construct_t, sprout::tuples::tuple first_args, sprout::tuples::tuple second_args ) : pair( first_args, second_args, sprout::index_pack::make(), sprout::index_pack::make() ) {} #endif // #if SPROUT_USE_DELEGATING_CONSTRUCTORS template template< typename U, typename V, typename > inline SPROUT_CONSTEXPR sprout::pair::pair(sprout::tuples::tuple const& other) : first(sprout::tuples::get<0>(other)) , second(sprout::tuples::get<1>(other)) {} template template< typename U, typename V, typename > inline SPROUT_CONSTEXPR sprout::pair::pair(sprout::tuples::tuple&& other) : first(SPROUT_FORWARD(U, sprout::tuples::get<0>(other))) , second(SPROUT_FORWARD(V, sprout::tuples::get<1>(other))) {} template template< typename U, typename V, typename > inline SPROUT_CXX14_CONSTEXPR sprout::pair& sprout::pair::operator=(sprout::tuples::tuple const& rhs) { first = sprout::tuples::get<0>(rhs); second = sprout::tuples::get<0>(rhs); return *this; } template template< typename U, typename V, typename > inline SPROUT_CXX14_CONSTEXPR sprout::pair& sprout::pair::operator=(sprout::tuples::tuple&& rhs) { first = SPROUT_FORWARD(U, sprout::tuples::get<0>(rhs)); second = SPROUT_FORWARD(V, sprout::tuples::get<1>(rhs)); return *this; } } // namespace sprout #endif // #ifndef SPROUT_UTILITY_PAIR_PAIR_HPP