summaryrefslogtreecommitdiff
path: root/libs/type_traits/doc/make_void.qbk
blob: 3ae0e3dc4a847208e7a0f3503a44e44eb56cd0b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[/
Copyright 2017 Glen Joseph Fernandes
<glenjofe -at- gmail.com>

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:make_void make_void]

    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 Examples

[[Expression] [Result Type]]

[[`make_void<int>::type`][`void`]]

[[`make_void<int&>::type`] [`void`]]

[[`make_void<int(*)(int)>::type`] [`void`]]

[[`make_void<int[]>::type`] [`void`]]

[[`make_void<int[1]>::type`] [`void`]]

[[`make_void<>::type`] [`void`]]

[[`make_void<int, int>::type`] [`void`]]

]

[all_compilers]  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.

[endsect]