From 8307f404f8e676f567b289e39bee0316d3cf0663 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 11 Feb 2018 05:40:41 +0200 Subject: [PATCH] Documentation fixes --- doc/mp11/algorithm.adoc | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/doc/mp11/algorithm.adoc b/doc/mp11/algorithm.adoc index ce7792c..aad27c4 100644 --- a/doc/mp11/algorithm.adoc +++ b/doc/mp11/algorithm.adoc @@ -203,7 +203,22 @@ As `mp_count_if`, but takes a quoted metafunction. template using mp_repeat_c = /*...*/; -`mp_repeat_c` returns a list of the same type as `L` that consists of `N` concatenated copies of `L`. +`mp_repeat_c` returns a list of the same form as `L` that consists of `N` concatenated copies of `L`. + +.Using mp_repeat_c +``` +using L1 = tuple; +using R1 = mp_repeat_c; // tuple + +using L2 = pair; +using R2 = mp_repeat_c; // pair + +using L3 = mp_list; +using R3 = mp_repeat_c; // mp_list + +using L4 = mp_list; +using R4 = mp_repeat_c; // mp_list<> +``` ## mp_repeat @@ -217,7 +232,7 @@ Same as `mp_repeat_c` but with a type argument `N`. The number of copies is `N:: `mp_product, L2, ..., Ln>` evaluates `F` for values `Ui` taken from the Cartesian product of the lists, as if the elements `Ui` are formed by `n` nested loops, each traversing `Li`. -It returns a list of type `L1` containing the results of the application of `F`. +It returns a list of the form `L1` containing the results of the application of `F`. .mp_product on two lists [cols="<.^4m,4*^.^1m",width=85%] @@ -266,7 +281,7 @@ Same as `mp_drop_c`, but with a type argument `N`. `N::value` must be a nonnegat `mp_from_sequence` transforms an integer sequence produced by `make_integer_sequence` into an `mp_list` of the corresponding `std::integral_constant` types. Given - template struct S; + template struct S; `mp_from_sequence>` is an alias for `mp_list...>`. @@ -306,7 +321,7 @@ Same as `mp_at_c`, but with a type argument `I`. `I::value` must be a nonnegativ template using mp_take_c = /*...*/; -`mp_take_c` returns a list of the same type as `L` containing the first `N` elements of `L`. +`mp_take_c` returns a list of the same form as `L` containing the first `N` elements of `L`. .mp_take_c [cols="<.^4m,6*^.^1m",width=85%] @@ -419,7 +434,7 @@ Same as `mp_replace_at_c`, but with a type argument `I`. `I::value` must be a no template class P> using mp_copy_if = /*...*/; -Copies the elements `T` of `L` for which `mp_to_bool>` is `mp_true` to a new list of the same type and returns it. +Copies the elements `T` of `L` for which `mp_to_bool>` is `mp_true` to a new list of the same form and returns it. ## mp_copy_if_q @@ -600,7 +615,7 @@ As `mp_reverse_fold`, but takes a quoted metafunction. template using mp_unique = /*...*/; -`mp_unique` returns a list of the same type as `L` with the duplicate elements removed. +`mp_unique` returns a list of the same form as `L` with the duplicate elements removed. ## mp_all_of