“Is there any advantage of aliasing type to value meta-functions?”
Quoting from the linked N3655, before the specifications of is_void_t
and siblings (page 4):
4 Supplementary proposed wording
The following wording is provided in response to LWG’s request that aliases for
::type
members be consistently provided for all the type traits, not only for those classified as TransformationTraits. Accordingly, this section provides the specifications needed in order to complete the set.
That explains why “type to value meta-functions (such as is_void
) are also type aliased” in the proposal: for consistency.
Moreover, it would be wrong to use the name “is_void_t
” to alias is_void<T>::value
. The “_t
” suffix always denotes a type. For the value, maybe one could use a “_v
” suffix. So we would then have both:
template <class T>
using is_void_t = typename is_void<T>::type;
template <class T>
constexpr bool is_void_v = is_void<T>::value;
That should compile in C++14, and then you could write things like enable_if_t<(is_void_v<T> || is_integral_v<T>),T>
. But I feel that the value alias is “less needed” than the type one: it doesn't save as much typing, and, as you said, you can use the short is_void<T>{}()
with the same effect (and for C++11, is_void<T>{}
is often enough, thanks to its operator bool()
).