forked from boostorg/type_traits
Small improvements to make_void:
* When there are no variadic templates, supports up to 5 parameters. * Tests added for void_t. * Documentation added on compiler support.
This commit is contained in:
@ -145,6 +145,7 @@
|
||||
<dt><span class="section"><a href="reference/is_volatile.html">is_volatile</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/make_signed.html">make_signed</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/make_unsigned.html">make_unsigned</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/make_void.html">make_void</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/promote.html">promote</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/rank.html">rank</a></span></dt>
|
||||
<dt><span class="section"><a href="reference/remove_all_extents.html">remove_all_extents</a></span></dt>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="make_signed.html" title="make_signed">
|
||||
<link rel="next" href="promote.html" title="promote">
|
||||
<link rel="next" href="make_void.html" title="make_void">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_signed.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="promote.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="make_signed.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="make_void.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@ -160,7 +160,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_signed.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="promote.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="make_signed.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="make_void.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
|
||||
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
|
||||
<link rel="up" href="../reference.html" title="Alphabetical Reference">
|
||||
<link rel="prev" href="make_unsigned.html" title="make_unsigned">
|
||||
<link rel="prev" href="make_void.html" title="make_void">
|
||||
<link rel="next" href="rank.html" title="rank">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
@ -20,7 +20,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_unsigned.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rank.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="make_void.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rank.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
@ -55,7 +55,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.promote.examples"></a><p class="title"><b>Table 1.25. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.promote.examples"></a><p class="title"><b>Table 1.26. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
@ -129,7 +129,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="make_unsigned.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rank.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="make_void.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="rank.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -50,7 +50,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.remove_all_extents.examples"></a><p class="title"><b>Table 1.26. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.remove_all_extents.examples"></a><p class="title"><b>Table 1.27. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -49,7 +49,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.remove_const.examples"></a><p class="title"><b>Table 1.27. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.remove_const.examples"></a><p class="title"><b>Table 1.28. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -49,7 +49,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.remove_cv.examples"></a><p class="title"><b>Table 1.28. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.remove_cv.examples"></a><p class="title"><b>Table 1.29. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -50,7 +50,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.remove_extent.examples"></a><p class="title"><b>Table 1.29. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.remove_extent.examples"></a><p class="title"><b>Table 1.30. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -51,7 +51,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.remove_pointer.examples"></a><p class="title"><b>Table 1.30. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.remove_pointer.examples"></a><p class="title"><b>Table 1.31. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -49,7 +49,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.remove_reference.examples"></a><p class="title"><b>Table 1.31. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.remove_reference.examples"></a><p class="title"><b>Table 1.32. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -49,7 +49,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.remove_volatile.examples"></a><p class="title"><b>Table 1.32. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.remove_volatile.examples"></a><p class="title"><b>Table 1.33. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -38,7 +38,7 @@
|
||||
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
|
||||
</p>
|
||||
<div class="table">
|
||||
<a name="boost_typetraits.reference.type_identity.examples"></a><p class="title"><b>Table 1.33. Examples</b></p>
|
||||
<a name="boost_typetraits.reference.type_identity.examples"></a><p class="title"><b>Table 1.34. Examples</b></p>
|
||||
<div class="table-contents"><table class="table" summary="Examples">
|
||||
<colgroup>
|
||||
<col>
|
||||
|
@ -201,6 +201,7 @@
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/is_volatile.html">is_volatile</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/make_signed.html">make_signed</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/make_unsigned.html">make_unsigned</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/make_void.html">make_void</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/promote.html">promote</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/rank.html">rank</a></span></dt>
|
||||
<dt><span class="section"><a href="boost_typetraits/reference/remove_all_extents.html">remove_all_extents</a></span></dt>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1038313"></a>Class Index</h2></div></div></div>
|
||||
<a name="id1079882"></a>Class Index</h2></div></div></div>
|
||||
<p><a class="link" href="s11.html#idx_id_0">A</a> <a class="link" href="s11.html#idx_id_2">C</a> <a class="link" href="s11.html#idx_id_3">D</a> <a class="link" href="s11.html#idx_id_4">E</a> <a class="link" href="s11.html#idx_id_5">F</a> <a class="link" href="s11.html#idx_id_6">H</a> <a class="link" href="s11.html#idx_id_7">I</a> <a class="link" href="s11.html#idx_id_8">M</a> <a class="link" href="s11.html#idx_id_9">N</a> <a class="link" href="s11.html#idx_id_10">O</a> <a class="link" href="s11.html#idx_id_11">P</a> <a class="link" href="s11.html#idx_id_12">R</a> <a class="link" href="s11.html#idx_id_13">T</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
@ -292,6 +292,7 @@
|
||||
<dd><div class="index"><ul class="index" style="list-style-type: none; ">
|
||||
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/make_signed.html" title="make_signed"><span class="index-entry-level-0">make_signed</span></a></p></li>
|
||||
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/make_unsigned.html" title="make_unsigned"><span class="index-entry-level-0">make_unsigned</span></a></p></li>
|
||||
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/make_void.html" title="make_void"><span class="index-entry-level-0">make_void</span></a></p></li>
|
||||
</ul></div></dd>
|
||||
<dt>
|
||||
<a name="idx_id_9"></a><span class="term">N</span>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1042408"></a>Typedef Index</h2></div></div></div>
|
||||
<a name="id1085112"></a>Typedef Index</h2></div></div></div>
|
||||
<p><a class="link" href="s12.html#idx_id_21">F</a> <a class="link" href="s12.html#idx_id_28">R</a> <a class="link" href="s12.html#idx_id_29">T</a> <a class="link" href="s12.html#idx_id_31">V</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
|
@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1042642"></a>Macro Index</h2></div></div></div>
|
||||
<a name="id1085346"></a>Macro Index</h2></div></div></div>
|
||||
<p><a class="link" href="s13.html#idx_id_33">B</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
|
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="id1046173"></a>Index</h2></div></div></div>
|
||||
<a name="id1083774"></a>Index</h2></div></div></div>
|
||||
<p><a class="link" href="s14.html#idx_id_48">A</a> <a class="link" href="s14.html#idx_id_49">B</a> <a class="link" href="s14.html#idx_id_50">C</a> <a class="link" href="s14.html#idx_id_51">D</a> <a class="link" href="s14.html#idx_id_52">E</a> <a class="link" href="s14.html#idx_id_53">F</a> <a class="link" href="s14.html#idx_id_54">H</a> <a class="link" href="s14.html#idx_id_55">I</a> <a class="link" href="s14.html#idx_id_56">M</a> <a class="link" href="s14.html#idx_id_57">N</a> <a class="link" href="s14.html#idx_id_58">O</a> <a class="link" href="s14.html#idx_id_59">P</a> <a class="link" href="s14.html#idx_id_60">R</a> <a class="link" href="s14.html#idx_id_61">T</a> <a class="link" href="s14.html#idx_id_62">U</a> <a class="link" href="s14.html#idx_id_63">V</a></p>
|
||||
<div class="variablelist"><dl class="variablelist">
|
||||
<dt>
|
||||
@ -839,6 +839,7 @@
|
||||
</li>
|
||||
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/make_signed.html" title="make_signed"><span class="index-entry-level-0">make_signed</span></a></p></li>
|
||||
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/make_unsigned.html" title="make_unsigned"><span class="index-entry-level-0">make_unsigned</span></a></p></li>
|
||||
<li class="listitem" style="list-style-type: none"><p><a class="link" href="../boost_typetraits/reference/make_void.html" title="make_void"><span class="index-entry-level-0">make_void</span></a></p></li>
|
||||
</ul></div></dd>
|
||||
<dt>
|
||||
<a name="idx_id_57"></a><span class="term">N</span>
|
||||
|
@ -42,6 +42,7 @@ __header ` #include <boost/type_traits/make_void.hpp>` or ` #include <boost/type
|
||||
|
||||
]
|
||||
|
||||
[all_compilers]
|
||||
[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]
|
||||
|
@ -24,8 +24,10 @@ struct make_void {
|
||||
template<class... Ts>
|
||||
using void_t = typename make_void<Ts...>::type;
|
||||
#endif
|
||||
#else
|
||||
template<class>
|
||||
|
||||
#else // BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
|
||||
template<class T = void, class U = void, class V = void, class X = void, class Y = void>
|
||||
struct make_void {
|
||||
typedef void type;
|
||||
};
|
||||
@ -34,6 +36,7 @@ struct make_void {
|
||||
template<class T>
|
||||
using void_t = typename make_void<T>::type;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
} /* boost */
|
||||
|
@ -26,9 +26,20 @@ BOOST_CHECK_TYPE(::tt::make_void<int(*)(int)>::type, void);
|
||||
BOOST_CHECK_TYPE(::tt::make_void<int[]>::type, void);
|
||||
BOOST_CHECK_TYPE(::tt::make_void<int[1]>::type, void);
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
BOOST_CHECK_TYPE(::tt::make_void<>::type, void);
|
||||
BOOST_CHECK_TYPE3(::tt::make_void<int, int>::type, void);
|
||||
|
||||
#ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
|
||||
BOOST_CHECK_TYPE(::tt::void_t<int>, void);
|
||||
BOOST_CHECK_TYPE(::tt::void_t<const volatile int>, void);
|
||||
BOOST_CHECK_TYPE(::tt::void_t<int&>, void);
|
||||
BOOST_CHECK_TYPE(::tt::void_t<void>, void);
|
||||
BOOST_CHECK_TYPE(::tt::void_t<int(*)(int)>, void);
|
||||
BOOST_CHECK_TYPE(::tt::void_t<int[]>, void);
|
||||
BOOST_CHECK_TYPE(::tt::void_t<int[1]>, void);
|
||||
|
||||
BOOST_CHECK_TYPE(::tt::void_t<>, void);
|
||||
BOOST_CHECK_TYPE3(::tt::void_t<int, int>, void);
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
Reference in New Issue
Block a user