forked from boostorg/type_traits
Merge branch 'develop'
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>
|
||||
|
48
doc/make_void.qbk
Normal file
48
doc/make_void.qbk
Normal file
@ -0,0 +1,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]
|
@ -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]
|
||||
|
@ -130,6 +130,7 @@
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/make_signed.hpp>
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
#include <boost/type_traits/make_void.hpp>
|
||||
#include <boost/type_traits/rank.hpp>
|
||||
#include <boost/type_traits/remove_all_extents.hpp>
|
||||
#include <boost/type_traits/remove_bounds.hpp>
|
||||
|
@ -46,7 +46,7 @@ template<> struct arithmetic_type<3>
|
||||
#endif
|
||||
|
||||
// There are five standard signed integer types:
|
||||
// “signed char”, “short int”, “int”, “long int”, and “long long int”.
|
||||
// "signed char", "short int", "int", "long int", and "long long int".
|
||||
|
||||
template<> struct arithmetic_type<4>
|
||||
{
|
||||
@ -79,8 +79,8 @@ template<> struct arithmetic_type<8>
|
||||
};
|
||||
|
||||
// For each of the standard signed integer types, there exists a corresponding
|
||||
// (but different) standard unsigned integer type: “unsigned char”, “unsigned short int”,
|
||||
// “unsigned int”, “unsigned long int”, and “unsigned long long int”
|
||||
// (but different) standard unsigned integer type: "unsigned char", "unsigned short int",
|
||||
// "unsigned int", "unsigned long int", and "unsigned long long int"
|
||||
|
||||
template<> struct arithmetic_type<9>
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
// (C) John Maddock 2010.
|
||||
// (C) Copyright John Maddock 2010.
|
||||
// Use, modification and distribution are subject to 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).
|
||||
|
52
include/boost/type_traits/make_void.hpp
Normal file
52
include/boost/type_traits/make_void.hpp
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
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)
|
||||
*/
|
||||
|
||||
#ifndef BOOST_TT_MAKE_VOID_HPP_INCLUDED
|
||||
#define BOOST_TT_MAKE_VOID_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class...>
|
||||
struct make_void {
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
template<class... Ts>
|
||||
using void_t = typename make_void<Ts...>::type;
|
||||
#endif
|
||||
|
||||
#else /* BOOST_NO_CXX11_VARIADIC_TEMPLATES */
|
||||
|
||||
template<class = void,
|
||||
class = void,
|
||||
class = void,
|
||||
class = void,
|
||||
class = void>
|
||||
struct make_void {
|
||||
typedef void type;
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
|
||||
template<class A = void,
|
||||
class B = void,
|
||||
class C = void,
|
||||
class D = void,
|
||||
class E = void>
|
||||
using void_t = typename make_void<A, B, C, D, E>::type;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
} /* boost */
|
||||
|
||||
#endif
|
@ -90,18 +90,18 @@ TT_TEST_BEGIN(common_type)
|
||||
#ifndef __SUNPRO_CC
|
||||
assignation_2<C1C2, C1>();
|
||||
typedef tt::common_type<C1C2&, C1&>::type T1;
|
||||
BOOST_CHECK_TYPE(T1, C1C2);
|
||||
BOOST_CHECK_TYPE(T1, C1C2);
|
||||
typedef tt::common_type<C3*, C2*>::type T2;
|
||||
BOOST_CHECK_TYPE(T2, C2*);
|
||||
BOOST_CHECK_TYPE(T2, C2*);
|
||||
typedef tt::common_type<int*, int const*>::type T3;
|
||||
BOOST_CHECK_TYPE(T3, int const*);
|
||||
BOOST_CHECK_TYPE(T3, int const*);
|
||||
#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
|
||||
// fails if BOOST_COMMON_TYPE_DONT_USE_TYPEOF:
|
||||
typedef tt::common_type<int volatile*, int const*>::type T4;
|
||||
BOOST_CHECK_TYPE(T4, int const volatile*);
|
||||
BOOST_CHECK_TYPE(T4, int const volatile*);
|
||||
#endif
|
||||
typedef tt::common_type<int*, int volatile*>::type T5;
|
||||
BOOST_CHECK_TYPE(T5, int volatile*);
|
||||
BOOST_CHECK_TYPE(T5, int volatile*);
|
||||
|
||||
assignation_2<C1, C1C2>();
|
||||
assignation_2<C1C2, C2>();
|
||||
|
@ -87,18 +87,18 @@ TT_TEST_BEGIN(common_type)
|
||||
{
|
||||
assignation_2<C1C2, C1>();
|
||||
typedef tt::common_type<C1C2&, C1&>::type T1;
|
||||
BOOST_CHECK_TYPE(T1, C1C2);
|
||||
BOOST_CHECK_TYPE(T1, C1C2);
|
||||
typedef tt::common_type<C3*, C2*>::type T2;
|
||||
BOOST_CHECK_TYPE(T2, C2*);
|
||||
BOOST_CHECK_TYPE(T2, C2*);
|
||||
typedef tt::common_type<int*, int const*>::type T3;
|
||||
BOOST_CHECK_TYPE(T3, int const*);
|
||||
BOOST_CHECK_TYPE(T3, int const*);
|
||||
#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
|
||||
// fails if BOOST_COMMON_TYPE_DONT_USE_TYPEOF:
|
||||
typedef tt::common_type<int volatile*, int const*>::type T4;
|
||||
BOOST_CHECK_TYPE(T4, int const volatile*);
|
||||
BOOST_CHECK_TYPE(T4, int const volatile*);
|
||||
#endif
|
||||
typedef tt::common_type<int*, int volatile*>::type T5;
|
||||
BOOST_CHECK_TYPE(T5, int volatile*);
|
||||
BOOST_CHECK_TYPE(T5, int volatile*);
|
||||
|
||||
assignation_2<C1, C1C2>();
|
||||
assignation_2<C1C2, C2>();
|
||||
|
@ -29,8 +29,8 @@ struct derived2 : public middle2 { };
|
||||
template<typename T>
|
||||
struct test_bug_4530
|
||||
{
|
||||
template<typename A>
|
||||
test_bug_4530(A&&, typename boost::enable_if< ::tt::is_convertible<A&&, T> >::type* =0);
|
||||
template<typename A>
|
||||
test_bug_4530(A&&, typename boost::enable_if< ::tt::is_convertible<A&&, T> >::type* =0);
|
||||
};
|
||||
|
||||
struct A4530
|
||||
|
45
test/make_void_test.cpp
Normal file
45
test/make_void_test.cpp
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
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)
|
||||
*/
|
||||
|
||||
#include "test.hpp"
|
||||
#include "check_type.hpp"
|
||||
|
||||
#ifdef TEST_STD
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/type_traits/make_void.hpp>
|
||||
#endif
|
||||
|
||||
TT_TEST_BEGIN(make_void)
|
||||
|
||||
BOOST_CHECK_TYPE(::tt::make_void<int>::type, void);
|
||||
BOOST_CHECK_TYPE(::tt::make_void<const volatile int>::type, void);
|
||||
BOOST_CHECK_TYPE(::tt::make_void<int&>::type, void);
|
||||
BOOST_CHECK_TYPE(::tt::make_void<void>::type, void);
|
||||
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);
|
||||
|
||||
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
|
@ -27,4 +27,4 @@ int dispatch_test()
|
||||
int main()
|
||||
{
|
||||
return (dispatch_test<int>() == 1) && (dispatch_test<void>() == 0) ? 0 : 1;
|
||||
}
|
||||
}
|
||||
|
@ -22,4 +22,4 @@ if_test<double>::type t2 = 0;
|
||||
int main()
|
||||
{
|
||||
return (int)(t1 + t2);
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,4 @@ int main()
|
||||
|
||||
lambda_test<list_type>::type i = 0;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user