blob: 3ae0e3dc4a847208e7a0f3503a44e44eb56cd0b4 [file] [log] [blame]
Brian Silverman4a2409e2018-08-04 23:24:02 -07001[/
2Copyright 2017 Glen Joseph Fernandes
3<glenjofe -at- gmail.com>
4
5Distributed under the Boost Software License,
6Version 1.0. (See accompanying file LICENSE_1_0.txt
7or copy at http://www.boost.org/LICENSE_1_0.txt).
8]
9
10[section:make_void make_void]
11
12 template<class...>
13 struct make_void
14 {
15 typedef void type;
16 };
17
18 template<class... Ts>
19 using void_t = typename make_void<Ts...>::type;
20
21__type The type `void` for all `T`.
22
23__header ` #include <boost/type_traits/make_void.hpp>` or ` #include <boost/type_traits.hpp>`
24
25[table Examples
26
27[[Expression] [Result Type]]
28
29[[`make_void<int>::type`][`void`]]
30
31[[`make_void<int&>::type`] [`void`]]
32
33[[`make_void<int(*)(int)>::type`] [`void`]]
34
35[[`make_void<int[]>::type`] [`void`]]
36
37[[`make_void<int[1]>::type`] [`void`]]
38
39[[`make_void<>::type`] [`void`]]
40
41[[`make_void<int, int>::type`] [`void`]]
42
43]
44
45[all_compilers] However, the type alias `void_t` is only available if the compiler supports template aliases.
46Further, in the absence of variadic-template support, `make_void` only supports up to 5 parameters.
47
48[endsect]