1
0
forked from boostorg/mp11
Files
boost_mp11/doc/mp11/function.qbk
2017-03-16 19:45:47 +02:00

41 lines
1.5 KiB
Plaintext

[/
/ 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:function Helper Metafunctions, `<boost/mp11/function.hpp>`]
[section `mp_and<T...>`]
template<class... T> using mp_and = /*...*/;
`mp_and<T...>` is an alias for the first type `U` in `T...` for which `mp_to_bool<U>` is `mp_false`.
If no such type exists, the last one is returned. `mp_and<>` is `mp_true`. Similar to `std::conjunction` in C++17.
[endsect]
[section `mp_all<T...>`]
template<class... T> using mp_all = /*...*/;
`mp_all<T...>` is `mp_true` if `mp_to_bool<U>` is `mp_true` for all types `U` in `T...`, `mp_false` otherwise. Same as
`mp_and`, but does not perform short-circuit evaluation. `mp_and<mp_false, void>` is `mp_false`, but `mp_all<mp_false, void>`
is an error because `void` does not have a nested `value`. The upside is that `mp_all` is faster.
[endsect]
[section `mp_or<T...>`]
template<class... T> using mp_or = /*...*/;
`mp_or<T...>` is an alias for the first type `U` in `T...` for which `mp_to_bool<U>` is `mp_true`.
If no such type exists, the last one is returned. `mp_or<>` is `mp_false`. Similar to `std::disjunction` in C++17.
[endsect]
[section `mp_any<T...>`]
template<class... T> using mp_any = /*...*/;
`mp_any<T...>` is `mp_true` if `mp_to_bool<U>` is `mp_true` for any type `U` in `T...`, `mp_false` otherwise. Same as
`mp_or`, but does not perform short-circuit evaluation.
[endsect]
[endsect]