From 647f66935323d5efcb5682612d258edf40552267 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 13 May 2017 21:07:54 +0300 Subject: [PATCH] Add mp_product_q, update documentation --- doc/html/mp11.html | 21 ++++++++++++++++++--- doc/mp11/algorithm.qbk | 6 ++++++ include/boost/mp11/algorithm.hpp | 1 + test/mp_product.cpp | 5 +++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/doc/html/mp11.html b/doc/html/mp11.html index 5f9f706..f5a0537 100644 --- a/doc/html/mp11.html +++ b/doc/html/mp11.html @@ -109,6 +109,7 @@
mp_repeat_c<L, N>
mp_repeat<L, N>
mp_product<F, L...>
+
mp_product_q<Q, L...>
mp_drop_c<L, N>
mp_drop<L, N>
mp_iota_c<N>
@@ -1122,6 +1123,17 @@
+
template<class Q, class... L> using mp_product_q = mp_product<Q::template fn, L...>;
+
+

+ As mp_product, but takes + a quoted metafunction. +

+
+
+
template<class L, std::size_t N> using mp_drop_c = /*...*/;
@@ -1343,8 +1355,11 @@
 
template<class L, class V> using mp_find = /*...*/;
 

- mp_find<L, V> is an alias for mp_size_t<I>, where I - is the zero-based index of the first occurence of V + mp_find<L, V> returns the index at which the type + V is located in the list + L. It's an alias for mp_size_t<I>, + where I is the zero-based + index of the first occurence of V in L. If L does not contain V, mp_find<L, V> is mp_size<L>.

@@ -1882,7 +1897,7 @@
- +

Last revised: May 12, 2017 at 21:20:08 GMT

Last revised: May 13, 2017 at 18:01:55 GMT


diff --git a/doc/mp11/algorithm.qbk b/doc/mp11/algorithm.qbk index b67cfa3..fe9cb95 100644 --- a/doc/mp11/algorithm.qbk +++ b/doc/mp11/algorithm.qbk @@ -83,6 +83,12 @@ the Cartesian product of the lists, as if the elements `Ui` are formed by `n` ne It returns a list of type `L1` containing the results of the application of `F`. [endsect] +[section `mp_product_q`] + template using mp_product_q = mp_product; + +As `mp_product`, but takes a quoted metafunction. +[endsect] + [section `mp_drop_c`] template using mp_drop_c = /*...*/; diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index 44439dd..6511c81 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -209,6 +209,7 @@ template class F, class L1, class... L> struct mp_product_imp } // namespace detail template class F, class... L> using mp_product = typename detail::mp_product_impl::type; +template using mp_product_q = typename detail::mp_product_impl::type; // mp_drop(_c) namespace detail diff --git a/test/mp_product.cpp b/test/mp_product.cpp index 696965b..25ef40f 100644 --- a/test/mp_product.cpp +++ b/test/mp_product.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -29,6 +30,8 @@ int main() { using boost::mp11::mp_list; using boost::mp11::mp_product; + using boost::mp11::mp_product_q; + using boost::mp11::mp_quote; { using L1 = std::tuple; @@ -36,6 +39,7 @@ int main() using L3 = std::pair; BOOST_TEST_TRAIT_TRUE((std::is_same, std::tuple, F, F, F, F, F>>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, L1, L2, L3>, std::tuple, F, F, F, F, F>>)); } { @@ -44,6 +48,7 @@ int main() using L3 = std::pair; BOOST_TEST_TRAIT_TRUE((std::is_same, std::tuple<>>)); + BOOST_TEST_TRAIT_TRUE((std::is_same, L1, L2, L3>, std::tuple<>>)); } return boost::report_errors();