diff --git a/doc/html/mp11.html b/doc/html/mp11.html index e3ed9a3..e5cab1b 100644 --- a/doc/html/mp11.html +++ b/doc/html/mp11.html @@ -2665,6 +2665,39 @@ It returns a list of type L1 containing the results of the applicat

mp_drop_c<L, N> removes the first N elements of L and returns the result.

+ + +++++++++ + + + + + + + + + + + + + + + + + + + + + +
Illustration 9. mp_drop_c

L1

A1

…​

Am

Am+1

…​

An

mp_drop_c<L1, M>

Am+1

…​

An

mp_drop<L, N>

@@ -2701,7 +2734,7 @@ It returns a list of type L1 containing the results of the applicat where T is the type of N::value.

- +@@ -2752,6 +2785,39 @@ where T is the type of N::value.

mp_take_c<L, N> returns a list of the same type as L containing the first N elements of L.

+
Illustration 9. mp_iotaIllustration 10. mp_iota
+ +++++++++ + + + + + + + + + + + + + + + + + + + + + +
Illustration 11. mp_take_c

L1

A1

…​

Am

Am+1

…​

An

mp_take_c<L1, M>

A1

…​

Am

mp_take<L, N>

@@ -2775,6 +2841,46 @@ where T is the type of N::value.

Inserts the elements T…​ into the list L at position I (a zero-based index).

+ + +++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Illustration 12. mp_insert_c with two elements

L1

A1

…​

Am

Am+1

…​

An

mp_insert_c<L1, M, B1, B2>

A1

…​

Am

B1

B2

Am+1

…​

An

mp_insert<L, I, T…​>

@@ -2799,6 +2905,48 @@ where T is the type of N::value.

Removes from the list L the elements with indices from I (inclusive) to J (exclusive).

+ + ++++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Illustration 13. mp_erase_c

L1

A0

…​

Ai-1

Ai

…​

Aj-1

Aj

…​

An-1

mp_erase_c<L1, I, J>

A0

…​

Ai-1

Aj

…​

An-1

mp_erase<L, I, J>

@@ -2823,7 +2971,7 @@ where T is the type of N::value.

Replaces all V elements of L with W and returns the result.

- +@@ -2863,7 +3011,7 @@ where T is the type of N::value.

Replaces all T elements of L for which mp_to_bool<P<T>> is mp_true with W and returns the result.

Illustration 10. mp_replaceIllustration 14. mp_replace
- +@@ -3025,7 +3173,7 @@ is mp_size<L>.

mp_reverse<L<T1, T2, …​, Tn>> is L<Tn, …​, T2, T1>.

Illustration 11. mp_replace_ifIllustration 15. mp_replace_if
- +@@ -3680,7 +3828,7 @@ expression f(std::get<J>(std::forward<Tp>(tp))) for - - \ No newline at end of file diff --git a/doc/mp11-docinfo-footer.html b/doc/mp11-docinfo-footer.html index 8cf495c..e81781d 100644 --- a/doc/mp11-docinfo-footer.html +++ b/doc/mp11-docinfo-footer.html @@ -4,30 +4,3 @@ table tr.even, table tr.alt, table tr:nth-of-type(even) { background: none; } - - diff --git a/doc/mp11/algorithm.adoc b/doc/mp11/algorithm.adoc index 8ba3884..855fdef 100644 --- a/doc/mp11/algorithm.adoc +++ b/doc/mp11/algorithm.adoc @@ -283,6 +283,14 @@ As `mp_product`, but takes a quoted metafunction. `mp_drop_c` removes the first `N` elements of `L` and returns the result. +.mp_drop_c +[cols="<.^4m,6*^.^1m",width=85%] +|=== +|*L1*|A~1~|...|A~m~|A~m+1~|...|A~n~ +7+| +|*mp_drop_c*|A~m+1~|...|A~n~ 3+| +|=== + ## mp_drop template using mp_drop = /*...*/; @@ -327,6 +335,14 @@ Same as `mp_at_c`, but with a type argument `I`. `I::value` must be a nonnegativ `mp_take_c` returns a list of the same type as `L` containing the first `N` elements of `L`. +.mp_take_c +[cols="<.^4m,6*^.^1m",width=85%] +|=== +|*L1*|A~1~|...|A~m~|A~m+1~|...|A~n~ +7+| +|*mp_take_c*|A~1~|...|A~m~ 3+| +|=== + ## mp_take template using mp_take = /*...*/; @@ -340,6 +356,14 @@ Same as `mp_take_c`, but with a type argument `N`. `N::value` must be a nonnegat Inserts the elements `T...` into the list `L` at position `I` (a zero-based index). +.mp_insert_c with two elements +[cols="<.^4m,8*^.^1m",width=85%] +|=== +|*L1*|A~1~|...|A~m~|A~m+1~|...|A~n~ 2+| +9+| +|*mp_insert_c*|A~1~|...|A~m~|B~1~|B~2~|A~m+1~|...|A~n~ +|=== + ## mp_insert template using mp_insert = @@ -354,6 +378,14 @@ Same as `mp_insert_c`, but with a type argument `I`. Removes from the list `L` the elements with indices from `I` (inclusive) to `J` (exclusive). +.mp_erase_c +[cols="<.^4m,9*^.^1m",width=85%] +|=== +|*L1*|A~0~|...|A~i-1~|A~i~|...|A~j-1~|A~j~|...|A~n-1~ +10+| +|*mp_erase_c*|A~0~|...|A~i-1~|A~j~|...|A~n-1~ 3+| +|=== + ## mp_erase template using mp_erase =
Illustration 12. mp_reverseIllustration 16. mp_reverse