[/ / 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, ``] [section `mp_void`] template using mp_void = void; Same as `std::void_t` from C++17. [endsect] [section `mp_and`] template using mp_and = /*...*/; `mp_and` is an alias for `mp_false` if there exists a type `U` in `T...` for which `mp_to_bool` is not `mp_true`. `mp_to_bool` is not evaluated for types after `U`. If no such type exists, `mp_and` is an alias for `mp_true`. (`mp_and<>` is `mp_true`.) using R1 = mp_and; // mp_true using R2 = mp_and; // mp_false, void is not reached using R3 = mp_and; // mp_false using R4 = mp_and; // mp_false (!) [endsect] [section `mp_all`] template using mp_all = /*...*/; `mp_all` is `mp_true` if `mp_to_bool` 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` is `mp_false`, but `mp_all` is an error because `void` does not have a nested `value`. The upside is that `mp_all` is faster on legacy compilers. using R1 = mp_and; // mp_true using R2 = mp_and; // compile-time error using R3 = mp_and; // mp_false using R4 = mp_and; // compile-time error [endsect] [section `mp_or`] template using mp_or = /*...*/; `mp_or` applies `mp_to_bool` to the types in `T...`, in order. If the result of an application is `mp_true`, `mp_or` returns `mp_true`. If all results are `mp_false`, returns `mp_false`. `mp_or<>` is `mp_false`. using R1 = mp_or; // mp_true using R2 = mp_or; // mp_true, void is not reached using R3 = mp_or; // mp_false using R4 = mp_or; // compile-time error [endsect] [section `mp_any`] template using mp_any = /*...*/; `mp_any` is `mp_true` if `mp_to_bool` is `mp_true` for any type `U` in `T...`, `mp_false` otherwise. Same as `mp_or`, but does not perform short-circuit evaluation. using R1 = mp_any; // mp_true using R2 = mp_any; // compile-time error using R3 = mp_any; // mp_false using R4 = mp_any; // compile-time error [endsect] [section `mp_same`] template using mp_same = /*...*/; `mp_same` is `mp_true` if all the types in `T...` are the same type, `mp_false` otherwise. `mp_same<>` is `mp_true`. [endsect] [endsect:function]