...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
template<class...> struct make_void { typedef void type; }; template<class... Ts> using void_t = typename make_void<Ts...>::type;
type: The type void
for all T
.
Header: #include
<boost/type_traits/make_void.hpp>
or #include <boost/type_traits.hpp>
Table 1.25. Examples
Expression |
Result Type |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Compiler Compatibility: All current compilers
are supported by this trait. However, the type alias void_t
is only available if the compiler supports template aliases. Further, in
the absence of variadic-template support, make_void
only supports up to 5 parameters.