[/ / Copyright 2017 Peter Dimov / / Distributed under the Boost Software License, Version 1.0. (See / accompanying file LICENSE_1_0.txt or copy at / http://www.boost.org/LICENSE_1_0.txt) /] [section:list List Operations, ``] [section `mp_list`] template struct mp_list {}; `mp_list` is the standard list type of Mp11, although the library is not restricted to it and can operate on arbitrary class templates such as `std::tuple` or `std::variant`. Even `std::pair` can be used if the transformation does not alter the number of the elements in the list. [endsect] [section `mp_size`] template using mp_size = /*...*/; `mp_size` returns the number of elements in the list `L`, as a `mp_size_t`. In other words, `mp_size>` is an alias for `mp_size_t`. [endsect] [section `mp_empty`] template using mp_empty = mp_bool::value == 0>; `mp_empty` is an alias for `mp_true` if the list `L` is empty, for `mp_false` otherwise. [endsect] [section `mp_front`] template using mp_front = /*...*/; `mp_front` is the first element of the list `L`. That is, `mp_front>` is an alias for `T1`. [endsect] [section `mp_pop_front`] template using mp_pop_front = /*...*/; `mp_pop_front` removes the first element of the list `L`. That is, `mp_pop_front>` is an alias for `L`. [endsect] [section `mp_first`] template using mp_first = mp_front; `mp_first` is another name for `mp_front`. [endsect] [section `mp_rest`] template using mp_rest = mp_pop_front; `mp_rest` is another name for `mp_pop_front`. [endsect] [section `mp_second`] template using mp_second = /*...*/; `mp_second` is the second element of the list `L`. That is, `mp_second>` is an alias for `T2`. [endsect] [section `mp_third`] template using mp_third = /*...*/; `mp_third` is the third element of the list `L`. That is, `mp_third>` is an alias for `T3`. [endsect] [section `mp_push_front`] template using mp_push_front = /*...*/; `mp_push_front` inserts the elements `T...` at the front of the list `L`. That is, `mp_push_front, T...>` is an alias for `L`. [endsect] [section `mp_push_back`] template using mp_push_back = /*...*/; `mp_push_back` inserts the elements `T...` at the back of the list `L`. That is, `mp_push_back, T...>` is an alias for `L`. [endsect] [section `mp_rename`] template class Y> using mp_rename = /*...*/; `mp_rename` changes the type of the list `L` to `Y`. That is, `mp_rename, Y>` is an alias for `Y`. [endsect] [section `mp_apply`] template class F, class L> using mp_apply = mp_rename; `mp_apply` applies the metafunction `F` to the contents of the list `L`, that is, `mp_apply>` is an alias for `F`. (`mp_apply` is the same as `mp_rename` with the arguments reversed.) [endsect] [section `mp_apply_q`] template using mp_apply_q = mp_apply; Same as `mp_apply`, but takes a quoted metafunction. [endsect] [section `mp_append`] template using mp_append = /*...*/; `mp_append` concatenates the lists in `L...` into a single list that has the same type as the first list. `mp_append<>` is an alias for `mp_list<>`. `mp_append, L2, ..., Ln>` is an alias for `L1`. [endsect] [section `mp_replace_front`] template using mp_replace_front = /*...*/; `mp_replace_front` replaces the first element of the list `L` with `T`. That is, `mp_replace_front, T>` is an alias for `L`. [endsect] [section `mp_replace_first`] template using mp_replace_first = mp_replace_front; `mp_replace_first` is another name for `mp_replace_front`. [endsect] [section `mp_replace_second`] template using mp_replace_second = /*...*/; `mp_replace_second` replaces the second element of the list `L` with `T`. That is, `mp_replace_second, T>` is an alias for `L`. [endsect] [section `mp_replace_third`] template using mp_replace_third = /*...*/; `mp_replace_third` replaces the third element of the list `L` with `T`. That is, `mp_replace_third, T>` is an alias for `L`. [endsect] [endsect:list]