forked from boostorg/mp11
Add mp_slice_c and mp_slice to the adoc file
This commit is contained in:
@@ -414,6 +414,28 @@ Supports a value list as `L` under {cpp}17.
|
||||
|
||||
Same as `mp_take_c`, but with a type argument `N`. `N::value` must be a nonnegative number.
|
||||
|
||||
## mp_slice_c<L, I, J>
|
||||
|
||||
template<class L, std::size_t I, std::size_t J> using mp_slice_c = mp_drop_c<mp_take_c<L, J>, I>;
|
||||
|
||||
`mp_slice_c<L, I, J>` returns a list of the same form as `L` containing the elements from index `I` (inclusive) to index `J` (exclusive).
|
||||
|
||||
Supports a value list as `L` under {cpp}17.
|
||||
|
||||
.mp_slice_c
|
||||
[cols="<.^4m,8*^.^1m",width=85%]
|
||||
|===
|
||||
|*L1*|A~0~|...|A~i~|...|A~j-1~|A~j~|...|A~n-1~
|
||||
9+|
|
||||
|*mp_slice_c<L1, I, J>* 2+>||A~i~|...|A~j-1~ 3+|
|
||||
|===
|
||||
|
||||
## mp_slice<L, I, J>
|
||||
|
||||
template<class L, class I, class J> using mp_slice = mp_drop<mp_take<L, J>, I>;
|
||||
|
||||
Same as `mp_slice_c`, but with type arguments `I` and `J`. `I::value` and `J::value` must be nonnegative numbers.
|
||||
|
||||
## mp_back<L>
|
||||
|
||||
template<class L> using mp_back = mp_at_c<L, mp_size<L>::value - 1>;
|
||||
|
Reference in New Issue
Block a user