From b5c87084afaef42b2d058f68091be31988a6a874 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 13 Sep 2017 11:08:07 +0900 Subject: Imported Upstream version 1.64.0 Change-Id: Id9212edd016dd55f21172c427aa7894d1d24148b Signed-off-by: DongHun Kwak --- libs/type_traits/doc/history.qbk | 6 +- .../doc/html/boost_typetraits/history.html | 30 ++-- .../doc/html/boost_typetraits/reference.html | 1 + .../boost_typetraits/reference/make_unsigned.html | 6 +- .../html/boost_typetraits/reference/make_void.html | 179 +++++++++++++++++++++ .../html/boost_typetraits/reference/promote.html | 8 +- .../reference/remove_all_extents.html | 2 +- .../boost_typetraits/reference/remove_const.html | 2 +- .../html/boost_typetraits/reference/remove_cv.html | 2 +- .../boost_typetraits/reference/remove_extent.html | 2 +- .../boost_typetraits/reference/remove_pointer.html | 2 +- .../reference/remove_reference.html | 2 +- .../reference/remove_volatile.html | 2 +- .../boost_typetraits/reference/type_identity.html | 2 +- libs/type_traits/doc/html/index.html | 1 + libs/type_traits/doc/html/index/s11.html | 3 +- libs/type_traits/doc/html/index/s12.html | 2 +- libs/type_traits/doc/html/index/s13.html | 2 +- libs/type_traits/doc/html/index/s14.html | 3 +- libs/type_traits/doc/html/standalone_HTML.manifest | 1 + libs/type_traits/doc/make_void.qbk | 48 ++++++ libs/type_traits/doc/type_traits.qbk | 2 + libs/type_traits/test/common_type_2_test.cpp | 10 +- libs/type_traits/test/common_type_test.cpp | 10 +- libs/type_traits/test/is_convertible_test.cpp | 4 +- libs/type_traits/test/make_void_test.cpp | 45 ++++++ libs/type_traits/test/mpl_interop_test1.cpp | 2 +- libs/type_traits/test/mpl_interop_test2.cpp | 2 +- libs/type_traits/test/mpl_interop_test3.cpp | 2 +- 29 files changed, 337 insertions(+), 46 deletions(-) create mode 100644 libs/type_traits/doc/html/boost_typetraits/reference/make_void.html create mode 100644 libs/type_traits/doc/make_void.qbk create mode 100644 libs/type_traits/test/make_void_test.cpp (limited to 'libs/type_traits') diff --git a/libs/type_traits/doc/history.qbk b/libs/type_traits/doc/history.qbk index 45abeef476..ed49f57fa3 100644 --- a/libs/type_traits/doc/history.qbk +++ b/libs/type_traits/doc/history.qbk @@ -7,7 +7,11 @@ [section:history History] -[h4 Boost 1.60.0 ???] +[h4 Boost 1.64.0] + +* Added new trait __make_void. + +[h4 Boost 1.60.0] * Refactored traits to depend only on Boost.Config. Greatly simplified code to improve readability and remove workarounds for old compilers no longer supported. * Fix __decay to follow C++11 semantics, see [@https://svn.boost.org/trac/boost/ticket/7760 #7760]. diff --git a/libs/type_traits/doc/html/boost_typetraits/history.html b/libs/type_traits/doc/html/boost_typetraits/history.html index 966697528b..3dcf2fb204 100644 --- a/libs/type_traits/doc/html/boost_typetraits/history.html +++ b/libs/type_traits/doc/html/boost_typetraits/history.html @@ -28,8 +28,16 @@
- Boost - 1.60.0 ??? + Boost + 1.64.0 +
+
+
+ + Boost + 1.60.0
  • @@ -50,7 +58,7 @@
- + Boost 1.58.0
@@ -65,7 +73,7 @@
- + Boost 1.57.0
@@ -79,7 +87,7 @@
- + Boost 1.56.0
@@ -88,7 +96,7 @@ #9474.
- + Boost 1.55.0
@@ -96,7 +104,7 @@ Added new trait is_copy_constructible.
- + Boost 1.54.0
@@ -107,7 +115,7 @@ has_trivial_move_constructor.
- + Boost 1.47.0
@@ -122,7 +130,7 @@
- + Boost 1.45.0
@@ -139,7 +147,7 @@
- + Boost 1.44.0
@@ -156,7 +164,7 @@
- + Boost 1.42.0
diff --git a/libs/type_traits/doc/html/boost_typetraits/reference.html b/libs/type_traits/doc/html/boost_typetraits/reference.html index bd14b22537..86a32f10a0 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference.html @@ -145,6 +145,7 @@
is_volatile
make_signed
make_unsigned
+
make_void
promote
rank
remove_all_extents
diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/make_unsigned.html b/libs/type_traits/doc/html/boost_typetraits/reference/make_unsigned.html index 5f72aa233a..42f8b818dc 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/make_unsigned.html @@ -7,7 +7,7 @@ - + @@ -20,7 +20,7 @@

-PrevUpHomeNext +PrevUpHomeNext

@@ -160,7 +160,7 @@
-PrevUpHomeNext +PrevUpHomeNext
diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/make_void.html b/libs/type_traits/doc/html/boost_typetraits/reference/make_void.html new file mode 100644 index 0000000000..c5ca4f2e94 --- /dev/null +++ b/libs/type_traits/doc/html/boost_typetraits/reference/make_void.html @@ -0,0 +1,179 @@ + + + +make_void + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
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 1.25. 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 +

+
+
+

+ Compiler Compatibility: All current compilers + are supported by this trait. 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. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/promote.html b/libs/type_traits/doc/html/boost_typetraits/reference/promote.html index be0df6325d..9b1faada22 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/promote.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/promote.html @@ -6,7 +6,7 @@ - + @@ -20,7 +20,7 @@
-PrevUpHomeNext +PrevUpHomeNext

@@ -55,7 +55,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.25. Examples

+

Table 1.26. Examples

@@ -129,7 +129,7 @@

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/remove_all_extents.html b/libs/type_traits/doc/html/boost_typetraits/reference/remove_all_extents.html index 9f1d999b82..b3723552a2 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/remove_all_extents.html @@ -50,7 +50,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.26. Examples

+

Table 1.27. Examples

diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/remove_const.html b/libs/type_traits/doc/html/boost_typetraits/reference/remove_const.html index 31bd8df5cf..706e40fcdb 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/remove_const.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/remove_const.html @@ -49,7 +49,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.27. Examples

+

Table 1.28. Examples

diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/remove_cv.html b/libs/type_traits/doc/html/boost_typetraits/reference/remove_cv.html index ee2ddf6d16..262437df5f 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/remove_cv.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/remove_cv.html @@ -49,7 +49,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.28. Examples

+

Table 1.29. Examples

diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/remove_extent.html b/libs/type_traits/doc/html/boost_typetraits/reference/remove_extent.html index c9918a31a7..09b50dd104 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/remove_extent.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/remove_extent.html @@ -50,7 +50,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.29. Examples

+

Table 1.30. Examples

diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/remove_pointer.html b/libs/type_traits/doc/html/boost_typetraits/reference/remove_pointer.html index fdcd481003..f7be89b289 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/remove_pointer.html @@ -51,7 +51,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.30. Examples

+

Table 1.31. Examples

diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/remove_reference.html b/libs/type_traits/doc/html/boost_typetraits/reference/remove_reference.html index 7f320c9413..535a5e2dfa 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/remove_reference.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/remove_reference.html @@ -49,7 +49,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.31. Examples

+

Table 1.32. Examples

diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/remove_volatile.html b/libs/type_traits/doc/html/boost_typetraits/reference/remove_volatile.html index d3c1b9c378..4a940a4579 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/remove_volatile.html @@ -49,7 +49,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.32. Examples

+

Table 1.33. Examples

diff --git a/libs/type_traits/doc/html/boost_typetraits/reference/type_identity.html b/libs/type_traits/doc/html/boost_typetraits/reference/type_identity.html index b549a7e36b..090bf823ef 100644 --- a/libs/type_traits/doc/html/boost_typetraits/reference/type_identity.html +++ b/libs/type_traits/doc/html/boost_typetraits/reference/type_identity.html @@ -38,7 +38,7 @@ or #include <boost/type_traits.hpp>

-

Table 1.33. Examples

+

Table 1.34. Examples

diff --git a/libs/type_traits/doc/html/index.html b/libs/type_traits/doc/html/index.html index d4b268183c..4929fad62c 100644 --- a/libs/type_traits/doc/html/index.html +++ b/libs/type_traits/doc/html/index.html @@ -201,6 +201,7 @@
is_volatile
make_signed
make_unsigned
+
make_void
promote
rank
remove_all_extents
diff --git a/libs/type_traits/doc/html/index/s11.html b/libs/type_traits/doc/html/index/s11.html index 8dcc99a764..0bbbcd8241 100644 --- a/libs/type_traits/doc/html/index/s11.html +++ b/libs/type_traits/doc/html/index/s11.html @@ -24,7 +24,7 @@

-Class Index

+Class Index

A C D E F H I M N O P R T

@@ -292,6 +292,7 @@
N diff --git a/libs/type_traits/doc/html/index/s12.html b/libs/type_traits/doc/html/index/s12.html index 6a0505182d..8f19af4011 100644 --- a/libs/type_traits/doc/html/index/s12.html +++ b/libs/type_traits/doc/html/index/s12.html @@ -24,7 +24,7 @@

-Typedef Index

+Typedef Index

F R T V

diff --git a/libs/type_traits/doc/html/index/s13.html b/libs/type_traits/doc/html/index/s13.html index c51e19d636..9e701e1264 100644 --- a/libs/type_traits/doc/html/index/s13.html +++ b/libs/type_traits/doc/html/index/s13.html @@ -24,7 +24,7 @@

-Macro Index

+Macro Index

B

diff --git a/libs/type_traits/doc/html/index/s14.html b/libs/type_traits/doc/html/index/s14.html index 03e8f20b14..ecc9eba1e8 100644 --- a/libs/type_traits/doc/html/index/s14.html +++ b/libs/type_traits/doc/html/index/s14.html @@ -23,7 +23,7 @@

-Index

+Index

A B C D E F H I M N O P R T U V

@@ -839,6 +839,7 @@
  • make_signed

  • make_unsigned

  • +
  • make_void

  • N diff --git a/libs/type_traits/doc/html/standalone_HTML.manifest b/libs/type_traits/doc/html/standalone_HTML.manifest index 129989d87c..832e4a7bd5 100644 --- a/libs/type_traits/doc/html/standalone_HTML.manifest +++ b/libs/type_traits/doc/html/standalone_HTML.manifest @@ -139,6 +139,7 @@ boost_typetraits/reference/is_void.html boost_typetraits/reference/is_volatile.html boost_typetraits/reference/make_signed.html boost_typetraits/reference/make_unsigned.html +boost_typetraits/reference/make_void.html boost_typetraits/reference/promote.html boost_typetraits/reference/rank.html boost_typetraits/reference/remove_all_extents.html diff --git a/libs/type_traits/doc/make_void.qbk b/libs/type_traits/doc/make_void.qbk new file mode 100644 index 0000000000..3ae0e3dc4a --- /dev/null +++ b/libs/type_traits/doc/make_void.qbk @@ -0,0 +1,48 @@ +[/ +Copyright 2017 Glen Joseph Fernandes + + +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 + struct make_void + { + typedef void type; + }; + + template + using void_t = typename make_void::type; + +__type The type `void` for all `T`. + +__header ` #include ` or ` #include ` + +[table Examples + +[[Expression] [Result Type]] + +[[`make_void::type`][`void`]] + +[[`make_void::type`] [`void`]] + +[[`make_void::type`] [`void`]] + +[[`make_void::type`] [`void`]] + +[[`make_void::type`] [`void`]] + +[[`make_void<>::type`] [`void`]] + +[[`make_void::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] diff --git a/libs/type_traits/doc/type_traits.qbk b/libs/type_traits/doc/type_traits.qbk index 8a914a4ae9..dd9bfc6312 100644 --- a/libs/type_traits/doc/type_traits.qbk +++ b/libs/type_traits/doc/type_traits.qbk @@ -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] diff --git a/libs/type_traits/test/common_type_2_test.cpp b/libs/type_traits/test/common_type_2_test.cpp index 8a4e74655d..114b4c281f 100644 --- a/libs/type_traits/test/common_type_2_test.cpp +++ b/libs/type_traits/test/common_type_2_test.cpp @@ -90,18 +90,18 @@ TT_TEST_BEGIN(common_type) #ifndef __SUNPRO_CC assignation_2(); typedef tt::common_type::type T1; - BOOST_CHECK_TYPE(T1, C1C2); + BOOST_CHECK_TYPE(T1, C1C2); typedef tt::common_type::type T2; - BOOST_CHECK_TYPE(T2, C2*); + BOOST_CHECK_TYPE(T2, C2*); typedef tt::common_type::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::type T4; - BOOST_CHECK_TYPE(T4, int const volatile*); + BOOST_CHECK_TYPE(T4, int const volatile*); #endif typedef tt::common_type::type T5; - BOOST_CHECK_TYPE(T5, int volatile*); + BOOST_CHECK_TYPE(T5, int volatile*); assignation_2(); assignation_2(); diff --git a/libs/type_traits/test/common_type_test.cpp b/libs/type_traits/test/common_type_test.cpp index 047b65fc02..3695a46b35 100644 --- a/libs/type_traits/test/common_type_test.cpp +++ b/libs/type_traits/test/common_type_test.cpp @@ -87,18 +87,18 @@ TT_TEST_BEGIN(common_type) { assignation_2(); typedef tt::common_type::type T1; - BOOST_CHECK_TYPE(T1, C1C2); + BOOST_CHECK_TYPE(T1, C1C2); typedef tt::common_type::type T2; - BOOST_CHECK_TYPE(T2, C2*); + BOOST_CHECK_TYPE(T2, C2*); typedef tt::common_type::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::type T4; - BOOST_CHECK_TYPE(T4, int const volatile*); + BOOST_CHECK_TYPE(T4, int const volatile*); #endif typedef tt::common_type::type T5; - BOOST_CHECK_TYPE(T5, int volatile*); + BOOST_CHECK_TYPE(T5, int volatile*); assignation_2(); assignation_2(); diff --git a/libs/type_traits/test/is_convertible_test.cpp b/libs/type_traits/test/is_convertible_test.cpp index 40764c033b..22b32019d4 100644 --- a/libs/type_traits/test/is_convertible_test.cpp +++ b/libs/type_traits/test/is_convertible_test.cpp @@ -29,8 +29,8 @@ struct derived2 : public middle2 { }; template struct test_bug_4530 { - template - test_bug_4530(A&&, typename boost::enable_if< ::tt::is_convertible >::type* =0); + template + test_bug_4530(A&&, typename boost::enable_if< ::tt::is_convertible >::type* =0); }; struct A4530 diff --git a/libs/type_traits/test/make_void_test.cpp b/libs/type_traits/test/make_void_test.cpp new file mode 100644 index 0000000000..986cdc4430 --- /dev/null +++ b/libs/type_traits/test/make_void_test.cpp @@ -0,0 +1,45 @@ +/* +Copyright 2017 Glen Joseph Fernandes + + +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 +#else +#include +#endif + +TT_TEST_BEGIN(make_void) + +BOOST_CHECK_TYPE(::tt::make_void::type, void); +BOOST_CHECK_TYPE(::tt::make_void::type, void); +BOOST_CHECK_TYPE(::tt::make_void::type, void); +BOOST_CHECK_TYPE(::tt::make_void::type, void); +BOOST_CHECK_TYPE(::tt::make_void::type, void); +BOOST_CHECK_TYPE(::tt::make_void::type, void); +BOOST_CHECK_TYPE(::tt::make_void::type, void); + +BOOST_CHECK_TYPE(::tt::make_void<>::type, void); +BOOST_CHECK_TYPE3(::tt::make_void::type, void); + +#ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES +BOOST_CHECK_TYPE(::tt::void_t, void); +BOOST_CHECK_TYPE(::tt::void_t, void); +BOOST_CHECK_TYPE(::tt::void_t, void); +BOOST_CHECK_TYPE(::tt::void_t, void); +BOOST_CHECK_TYPE(::tt::void_t, void); +BOOST_CHECK_TYPE(::tt::void_t, void); +BOOST_CHECK_TYPE(::tt::void_t, void); + +BOOST_CHECK_TYPE(::tt::void_t<>, void); +BOOST_CHECK_TYPE3(::tt::void_t, void); +#endif + +TT_TEST_END diff --git a/libs/type_traits/test/mpl_interop_test1.cpp b/libs/type_traits/test/mpl_interop_test1.cpp index 214c951317..3b90418e9e 100644 --- a/libs/type_traits/test/mpl_interop_test1.cpp +++ b/libs/type_traits/test/mpl_interop_test1.cpp @@ -27,4 +27,4 @@ int dispatch_test() int main() { return (dispatch_test() == 1) && (dispatch_test() == 0) ? 0 : 1; -} \ No newline at end of file +} diff --git a/libs/type_traits/test/mpl_interop_test2.cpp b/libs/type_traits/test/mpl_interop_test2.cpp index 4624e0baa1..85805c89fc 100644 --- a/libs/type_traits/test/mpl_interop_test2.cpp +++ b/libs/type_traits/test/mpl_interop_test2.cpp @@ -22,4 +22,4 @@ if_test::type t2 = 0; int main() { return (int)(t1 + t2); -} \ No newline at end of file +} diff --git a/libs/type_traits/test/mpl_interop_test3.cpp b/libs/type_traits/test/mpl_interop_test3.cpp index 0a4c8ac29f..e89d50e5a9 100644 --- a/libs/type_traits/test/mpl_interop_test3.cpp +++ b/libs/type_traits/test/mpl_interop_test3.cpp @@ -27,4 +27,4 @@ int main() lambda_test::type i = 0; return i; -} \ No newline at end of file +} -- cgit v1.2.3