[/ / 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:utility Utility Components, ``] [section `mp_identity`] template struct mp_identity { using type = T; }; [endsect] [section `mp_identity_t`] template using mp_identity_t = T; [endsect] [section `mp_inherit`] template struct mp_inherit: T... {}; [endsect] [section `mp_if_c`] template using mp_if_c = /*...*/; `mp_if_c` is an alias for `T` when `B` is `true`, for `E` otherwise. [endsect] [section `mp_if`] template using mp_if = mp_if_c(C::value), T, E>; `mp_if` is an alias for `T` when `C::value` is `true`, for `E` otherwise. [endsect] [section `mp_eval_if_c`] template class F, class... U> using mp_eval_if_c = /*...*/; `mp_eval_if_c` is an alias for `T` when `B` is `true`, for `F` otherwise. Its purpose is to avoid evaluating `F` when the condition is `true` as it may not be valid in this case. [endsect] [section `mp_eval_if`] template class F, class... U> using mp_eval_if = mp_eval_if_c(C::value), T, F, U...>; Like `mp_eval_if_c`, but the first argument is a type. [endsect] [section `mp_valid`] template class F, class... T> using mp_valid = /*...*/; `mp_valid` is an alias for `mp_true` when `F` is a valid expression, for `mp_false` otherwise. [endsect] [section `mp_defer`] template class F, class... T> using mp_defer = /*...*/; When `mp_valid` is `mp_true`, `mp_defer` is a struct with a nested type `type` which is an alias for `F`. Otherwise, `mp_defer` is an empty struct. [endsect] [section `mp_quote`] template class F, class... T> struct mp_quote { template using fn = F; }; `mp_quote` transforms the template `F` into a type. In the common case `mp_quote`, the nested template `fn` of the result is an alias for `F`; otherwise, `fn` is an alias for `F`, allowing partial application. [endsect] [section `mp_invoke`] template using mp_invoke = typename Q::template fn; `mp_invoke` evaluates the nested template `fn` of a quoted metafunction. `mp_invoke, T...>` is an alias for `F`. `mp_invoke, U...>` is an alias for `F`. [endsect] [endsect]