/*============================================================================= Copyright (c) 2011-2017 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_OPERATION_POP_BACK_HPP #define SPROUT_TUPLE_OPERATION_POP_BACK_HPP #include #include #include #include #include namespace sprout { namespace tuples { namespace results { // // pop_back // template struct pop_back : public sprout::types::pop_back {}; } // namespace results namespace detail { template inline SPROUT_CONSTEXPR Result pop_back_impl(Tuple const& t, sprout::index_tuple) { return sprout::tuples::remake( t, sprout::tuples::get(t)... ); } } // namespace detail // // pop_back // template inline SPROUT_CONSTEXPR typename sprout::tuples::results::pop_back::type pop_back(Tuple const& t) { return sprout::tuples::detail::pop_back_impl::type>( t, sprout::make_index_tuple::value - 1>::make() ); } } // namespace tuples } // namespace sprout #endif // #ifndef SPROUT_TUPLE_OPERATION_POP_BACK_HPP