1
0
forked from boostorg/mp11

Move mp_assign, mp_clear from algorithm to list

This commit is contained in:
Peter Dimov
2017-10-14 20:11:02 +03:00
parent 018d71bb72
commit 321f5fdb24
6 changed files with 56 additions and 69 deletions

View File

@@ -13,50 +13,6 @@ http://www.boost.org/LICENSE_1_0.txt
:toc-title:
:idprefix:
## mp_assign<L1, L2>
template<class L1, class L2> using mp_assign = /*...*/;
`mp_assign<L1<T1...>, L2<T2...>>` is an alias for `L1<T2...>`. That is, it replaces the elements of `L1` with those of `L2`.
.Using mp_assign with mp_list and std::tuple
```
using L1 = std::tuple<long>;
using L2 = mp_list<int, float>;
using R1 = mp_assign<L1, L2>; // std::tuple<int, float>
```
.Using mp_assign with mp_list and std::pair
```
using L1 = std::pair<long, char>;
using L2 = mp_list<int, float>;
using R1 = mp_assign<L1, L2>; // std::pair<int, float>
```
.mp_assign
[cols="<.^4m,4*^.^1m",width=85%]
|===
|*L1*|A~1~|A~2~|...|A~n~
5+|
|*L2*|B~1~|B~2~|...|B~n~
5+|
|*mp_assign<L1, L2>*|B~1~|B~2~|...|B~n~
|===
## mp_clear<L>
template<class L> using mp_clear = mp_assign<L, mp_list<>>;
`mp_clear<L<T...>>` is an alias for `L<>`, that is, it removes the elements of `L`.
.Using mp_clear with std::tuple
```
using L1 = std::tuple<int, float>;
using R1 = mp_clear<L1>; // std::tuple<>
```
## mp_transform<F, L...>
template<template<class...> class F, class... L> using mp_transform = /*...*/;