1
0
forked from boostorg/mp11
Files
boost_mp11/doc/mp11/tuple_for_each.adoc

22 lines
678 B
Plaintext
Raw Normal View History

2017-06-07 00:02:25 +03:00
////
Copyright 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
////
[#tuple_for_each]
# A "for each" algorithm for tuple-like types, <boost/mp11/tuple_for_each.hpp>
:idprefix:
## tuple_for_each(tp, f)
template<class Tp, class F> constexpr F tuple_for_each(Tp&& tp, F&& f);
`tuple_for_each(tp, f)` applies the function object `f` to each element of `tp` by evaluating the
expression `f(std::get<J>(std::forward<Tp>(tp)))` for `J` in 0..`N-1`, where `N` is `std::tuple_size<typename std::remove_reference<Tp>::type>::value`.
Returns `std::forward<F>(f)`.