#ifndef BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED #define BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED // Copyright 2015-2020, 2024 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 #if defined(BOOST_MSVC) # pragma warning( push ) # pragma warning( disable: 4100 ) // unreferenced formal parameter 'tp' #endif namespace boost { namespace _bi { // tuple_for_each( f, tp ) template F tuple_for_each_impl( F&& f, Tp&& tp, integer_sequence ) { using A = int[ 1 + sizeof...(J) ]; using std::get; return (void)A{ 0, ((void)f(get(std::forward(tp))), 0)... }, std::forward(f); } template F tuple_for_each( F&& f, Tp&& tp ) { using seq = make_index_sequence::type>::value>; return _bi::tuple_for_each_impl( std::forward(f), std::forward(tp), seq() ); } // tuple_for_each( f, tp1, tp2 ) template F tuple_for_each_impl( F&& f, Tp1&& tp1, Tp2&& tp2, integer_sequence ) { using A = int[ 1 + sizeof...(J) ]; using std::get; return (void)A{ 0, ((void)f( get(std::forward(tp1)), get(std::forward(tp2)) ), 0)... }, std::forward(f); } template F tuple_for_each( F&& f, Tp1&& tp1, Tp2&& tp2 ) { using seq = make_index_sequence::type>::value>; return _bi::tuple_for_each_impl( std::forward(f), std::forward(tp1), std::forward(tp2), seq() ); } } // namespace _bi } // namespace boost #if defined(BOOST_MSVC) # pragma warning( pop ) #endif #endif // #ifndef BOOST_BIND_DETAIL_TUPLE_FOR_EACH_HPP_INCLUDED