1
0
forked from boostorg/mp11

Update documentation

This commit is contained in:
Peter Dimov
2023-05-16 20:04:03 +03:00
parent c1787b95d6
commit ce005d77ce
2 changed files with 17 additions and 1 deletions

View File

@@ -178,6 +178,8 @@ using R1 = mp_filter_q<_2, L1, L2>; // std::tuple<void, float>
`mp_fill<L<T...>, V>` returns `L<V, V, ..., V>`, 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<void, int, float>;
@@ -190,6 +192,12 @@ using L1 = std::pair<int, float>;
using R1 = mp_fill<L1, void>; // std::pair<void, void>
```
.Using mp_fill with mp_list_v
```
using L1 = mp_list_v<true, false>;
using R1 = mp_fill<L1, mp_int<7>>; // 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<L, I>` 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<L, I>
template<class L, class I> 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<L, N>` 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<L>` 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<L>
template<class L> using mp_pop_back = mp_take_c<L, mp_size<L>::value - 1>;
`mp_pop_back<L>` removes the last element of the list `L` and returns the result.
Supports a value list as `L` under {cpp}17.
## mp_insert_c<L, I, T...>
template<class L, std::size_t I, class... T> using mp_insert_c =

View File

@@ -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 `<boost/mp11/list.hpp>`.
* 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