Add make_void and void_t traits

This commit is contained in:
Glen Fernandes committed 2017-01-30 19:50:38 -05:00
1 parent 4fffc7637d
commit d24f722c5a
5 files changed
+125

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
[/
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]
[endsect]
+2
View File
@@ -134,6 +134,7 @@
[def __make_signed [link boost_typetraits.reference.make_signed make_signed]]
[def __make_unsigned [link boost_typetraits.reference.make_unsigned make_unsigned]]
[def __make_void [link boost_typetraits.reference.make_void make_void]]
[def __decay [link boost_typetraits.reference.decay decay]]
[def __is_complex [link boost_typetraits.reference.is_complex is_complex]]
@@ -316,6 +317,7 @@ See __has_trivial_constructor.
[include make_signed.qbk]
[include make_unsigned.qbk]
[include make_void.qbk]
[include promote.qbk]
[include rank.qbk]