Add mp_for_index

This commit is contained in:
Peter Dimov committed 2017-05-31 19:56:18 +03:00
1 parent 1506f05fbb
commit e6c28a0848
7 files changed
+498 -4

No files matched your search

+12
View File
@@ -289,4 +289,16 @@ is `mp_size<L>`.
Returns `std::forward<F>(f)`.
[endsect]
[section `mp_for_index_c<N>(i, f)`]
template<std::size_t N, class F> decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) mp_for_index( std::size_t i, F && f );
`mp_for_index_c<N>(i, f)` calls `f` with `mp_size_t<i>()` and returns the result. `i` must be less than `N`.
[endsect]
[section `mp_for_index<N>(i, f)`]
template<class N, class F> decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) mp_for_index( std::size_t i, F && f );
Returns `mp_for_index_c<N::value>(i, f)`.
[endsect]
[endsect:algorithm]