1
0
forked from boostorg/mp11
Files
boost_mp11/doc/mp11/set.adoc

62 lines
1.8 KiB
Plaintext
Raw Normal View History

2017-06-07 00:02:25 +03:00
////
Copyright 2017 Peter Dimov
2017-03-14 22:57:07 +02:00
2017-06-07 00:02:25 +03:00
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
////
[#set]
# Set Operations, <boost/mp11/set.hpp>
:toc:
2017-06-07 00:13:13 +03:00
:toc-title:
2017-06-07 00:02:25 +03:00
:idprefix:
2017-03-14 22:57:07 +02:00
A set is a list whose elements are unique.
2017-07-17 19:28:36 +03:00
## mp_is_set<S>
template<class S> using mp_is_set = /*...*/;
`mp_is_set<S>` is `mp_true` if `S` is a set, `mp_false` otherwise.
2017-06-07 00:02:25 +03:00
## mp_set_contains<S, V>
2017-03-14 22:57:07 +02:00
template<class S, class V> using mp_set_contains = /*...*/;
`mp_set_contains<S, V>` is `mp_true` if the type `V` is an element of the set `S`, `mp_false` otherwise.
2017-06-07 00:02:25 +03:00
## mp_set_push_back<S, T...>
2017-03-14 22:57:07 +02:00
template<class S, class... T> using mp_set_push_back = /*...*/;
2019-01-07 06:50:51 +02:00
For each `T1` in `T...`, `mp_set_push_back<S, T...>` appends `T1` to the end of the set `S` if it's not already an element of `S`.
2017-03-14 22:57:07 +02:00
2017-06-07 00:02:25 +03:00
## mp_set_push_front<S, T...>
2017-03-14 22:57:07 +02:00
template<class S, class... T> using mp_set_push_front = /*...*/;
2019-01-07 06:50:51 +02:00
`mp_set_push_front<S, T...>` inserts at the front of the set `S` those elements of `T...` for which `S` does not already contain the same type.
## mp_set_union<L...>
template<class... L> using mp_set_union = /*...*/;
`mp_set_union<S, L...>` is `mp_set_push_back<S, T...>`, where `T...` are the combined elements of the lists `L...`.
2019-01-07 06:50:51 +02:00
`mp_set_union<>` is `mp_list<>`.
## mp_set_intersection<S...>
template<class... S> using mp_set_intersection = /*...*/;
`mp_set_intersection<S...>` returns a set that contains the elements that occur in all of the sets `S...`.
`mp_set_intersection<>` is `mp_list<>`.
## mp_set_difference<L, S...>
template<class L, class... S> using mp_set_difference = /*...*/;
`mp_set_difference<L, S...>` removes the elements of the list `L` that appear in any of the sets `S...` and
returns the result.