diff --git a/doc/mp11/algorithm.adoc b/doc/mp11/algorithm.adoc index 040cf6e..8af370a 100644 --- a/doc/mp11/algorithm.adoc +++ b/doc/mp11/algorithm.adoc @@ -178,6 +178,8 @@ using R1 = mp_filter_q<_2, L1, L2>; // std::tuple `mp_fill, V>` returns `L`, with the result having the same size as the input. +Supports a value list as `L` under {cpp}17. In that case, the elements are replaced with `V::value`. + .Using mp_fill with std::tuple ``` using L1 = std::tuple; @@ -190,6 +192,12 @@ using L1 = std::pair; using R1 = mp_fill; // std::pair ``` +.Using mp_fill with mp_list_v +``` +using L1 = mp_list_v; +using R1 = mp_fill>; // mp_list_v<7, 7> +``` + .mp_fill [cols="<.^4m,4*^.^1m",width=85%] |=== @@ -374,6 +382,8 @@ where `T` is the type of `N::value`. `mp_at_c` returns the `I`-th element of `L`, zero-based. +Supports a value list as `L` under {cpp}17. In that case, the element is returned wrapped with `mp_value`. + ## mp_at template using mp_at = /*...*/; @@ -386,6 +396,8 @@ 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 form as `L` containing the first `N` elements of `L`. +Supports a value list as `L` under {cpp}17. + .mp_take_c [cols="<.^4m,6*^.^1m",width=85%] |=== @@ -406,12 +418,16 @@ Same as `mp_take_c`, but with a type argument `N`. `N::value` must be a nonnegat `mp_back` returns the last element of the list `L`. +Supports a value list as `L` under {cpp}17. In that case, the element is returned wrapped with `mp_value`. + ## mp_pop_back template using mp_pop_back = mp_take_c::value - 1>; `mp_pop_back` removes the last element of the list `L` and returns the result. +Supports a value list as `L` under {cpp}17. + ## mp_insert_c template using mp_insert_c = diff --git a/doc/mp11/changelog.adoc b/doc/mp11/changelog.adoc index cd4c0f5..f21b01c 100644 --- a/doc/mp11/changelog.adoc +++ b/doc/mp11/changelog.adoc @@ -15,7 +15,7 @@ http://www.boost.org/LICENSE_1_0.txt * Added an offset/from parameter to `mp_from_sequence`, `mp_iota`, `mp_iota_c`. * Added `mp_value`, `mp_list_v`, `mp_rename_v`, `mp_is_value_list`. * Added value list support to the primitives in ``. -* Added value list support to `mp_repeat`. +* Added value list support to `mp_repeat`, `mp_fill`, `mp_at`, `mp_back`, `mp_take`, `mp_pop_back`. ## Changes in 1.79.0