1
0
forked from boostorg/mp11

Update documentation

This commit is contained in:
Peter Dimov
2017-05-24 05:58:06 +03:00
parent fc562c7421
commit 8e1da77904
2 changed files with 15 additions and 15 deletions

View File

@@ -17,9 +17,9 @@ Same as `std::void_t` from C++17.
[section `mp_and<T...>`]
template<class... T> using mp_and = /*...*/;
`mp_and<T...>` is an alias for `mp_false` if there exists a type `U` in `T...` for which `mp_to_bool<U>` is not `mp_true`.
`mp_to_bool<U>` is not evaluated for types after `U`. If no such type exists, `mp_and<T...>` is an alias for `mp_true`.
(`mp_and<>` is `mp_true`.)
`mp_and<T...>` applies `mp_to_bool` to the types in `T...`, in order. If the result of an application is `mp_false`, `mp_and`
returns `mp_false`. If the application causes a substitution failure, returns `mp_false`. If all results are `mp_true`,
returns `mp_true`. `mp_and<>` is `mp_true`.
using R1 = mp_and<mp_true, mp_true>; // mp_true
using R2 = mp_and<mp_false, void>; // mp_false, void is not reached
@@ -32,7 +32,8 @@ Same as `std::void_t` from C++17.
`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 on legacy compilers.
is an error because `void` does not have a nested `value`. The upside is that `mp_all` is potentially faster and does not
mask substitution failures as `mp_and` does.
using R1 = mp_and<mp_true, mp_true>; // mp_true
using R2 = mp_and<mp_false, void>; // compile-time error