#ifndef BOOST_MP11_TUPLE_FOR_EACH_HPP_INCLUDED #define BOOST_MP11_TUPLE_FOR_EACH_HPP_INCLUDED // Copyright 2015, 2017 Peter Dimov. // // 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 #include #include #include #include #include #include #include namespace boost { namespace mp11 { namespace detail { template BOOST_CONSTEXPR F tuple_for_each_impl( Tp && tp, integer_sequence, F && f ) { using A = int[sizeof...(J)]; return (void)A{ ((void)f(std::get(std::forward(tp))), 0)... }, std::forward(f); } #if BOOST_WORKAROUND( BOOST_MSVC, <= 1800 ) template BOOST_CONSTEXPR F tuple_for_each_impl( Tp && tp, integer_sequence, F && f ) { return std::forward(f); } #endif } // namespace detail template BOOST_CONSTEXPR F tuple_for_each( Tp && tp, F && f ) { using seq = make_index_sequence::type>::value>; return detail::tuple_for_each_impl( std::forward(tp), seq(), std::forward(f) ); } } // namespace mp11 } // namespace boost #endif // #ifndef BOOST_TUPLE_FOR_EACH_HPP_INCLUDED