diff --git a/doc/html/boost_typetraits/reference.html b/doc/html/boost_typetraits/reference.html index f1cfab2..b463bc6 100644 --- a/doc/html/boost_typetraits/reference.html +++ b/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/doc/html/boost_typetraits/reference/make_unsigned.html b/doc/html/boost_typetraits/reference/make_unsigned.html index 914cacf..740206e 100644 --- a/doc/html/boost_typetraits/reference/make_unsigned.html +++ b/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/doc/html/boost_typetraits/reference/promote.html b/doc/html/boost_typetraits/reference/promote.html index 69a600b..c1bd9df 100644 --- a/doc/html/boost_typetraits/reference/promote.html +++ b/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/doc/html/boost_typetraits/reference/remove_all_extents.html b/doc/html/boost_typetraits/reference/remove_all_extents.html index 3b844e9..a1e4beb 100644 --- a/doc/html/boost_typetraits/reference/remove_all_extents.html +++ b/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/doc/html/boost_typetraits/reference/remove_const.html b/doc/html/boost_typetraits/reference/remove_const.html index 77753f1..ed4e887 100644 --- a/doc/html/boost_typetraits/reference/remove_const.html +++ b/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/doc/html/boost_typetraits/reference/remove_cv.html b/doc/html/boost_typetraits/reference/remove_cv.html index 91ac299..bbb0956 100644 --- a/doc/html/boost_typetraits/reference/remove_cv.html +++ b/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/doc/html/boost_typetraits/reference/remove_extent.html b/doc/html/boost_typetraits/reference/remove_extent.html index 05ffeff..9a570c4 100644 --- a/doc/html/boost_typetraits/reference/remove_extent.html +++ b/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/doc/html/boost_typetraits/reference/remove_pointer.html b/doc/html/boost_typetraits/reference/remove_pointer.html index bf2d59f..d94817f 100644 --- a/doc/html/boost_typetraits/reference/remove_pointer.html +++ b/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/doc/html/boost_typetraits/reference/remove_reference.html b/doc/html/boost_typetraits/reference/remove_reference.html index 37caa50..439559b 100644 --- a/doc/html/boost_typetraits/reference/remove_reference.html +++ b/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/doc/html/boost_typetraits/reference/remove_volatile.html b/doc/html/boost_typetraits/reference/remove_volatile.html index 155fb13..f9eeba6 100644 --- a/doc/html/boost_typetraits/reference/remove_volatile.html +++ b/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/doc/html/boost_typetraits/reference/type_identity.html b/doc/html/boost_typetraits/reference/type_identity.html index d22ea1d..f8de9b0 100644 --- a/doc/html/boost_typetraits/reference/type_identity.html +++ b/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/doc/html/index.html b/doc/html/index.html index e4aedc8..9e05e5d 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -201,6 +201,7 @@
is_volatile
make_signed
make_unsigned
+
make_void
promote
rank
remove_all_extents
diff --git a/doc/html/index/s11.html b/doc/html/index/s11.html index 21f2f0c..d064ef4 100644 --- a/doc/html/index/s11.html +++ b/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/doc/html/index/s12.html b/doc/html/index/s12.html index 11c8909..80cb632 100644 --- a/doc/html/index/s12.html +++ b/doc/html/index/s12.html @@ -24,7 +24,7 @@

-Typedef Index

+Typedef Index

F R T V

diff --git a/doc/html/index/s13.html b/doc/html/index/s13.html index b68627b..140f57b 100644 --- a/doc/html/index/s13.html +++ b/doc/html/index/s13.html @@ -24,7 +24,7 @@

-Macro Index

+Macro Index

B

diff --git a/doc/html/index/s14.html b/doc/html/index/s14.html index a0aa114..767f4ba 100644 --- a/doc/html/index/s14.html +++ b/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/doc/make_void.qbk b/doc/make_void.qbk new file mode 100644 index 0000000..3ae0e3d --- /dev/null +++ b/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/doc/type_traits.qbk b/doc/type_traits.qbk index 8a914a4..dd9bfc6 100644 --- a/doc/type_traits.qbk +++ b/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/include/boost/type_traits.hpp b/include/boost/type_traits.hpp index 7d651ce..93a992d 100644 --- a/include/boost/type_traits.hpp +++ b/include/boost/type_traits.hpp @@ -130,6 +130,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/type_traits/detail/common_arithmetic_type.hpp b/include/boost/type_traits/detail/common_arithmetic_type.hpp index 8c09158..a7aff03 100644 --- a/include/boost/type_traits/detail/common_arithmetic_type.hpp +++ b/include/boost/type_traits/detail/common_arithmetic_type.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> { diff --git a/include/boost/type_traits/is_rvalue_reference.hpp b/include/boost/type_traits/is_rvalue_reference.hpp index 50e88ed..a48edb5 100644 --- a/include/boost/type_traits/is_rvalue_reference.hpp +++ b/include/boost/type_traits/is_rvalue_reference.hpp @@ -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). diff --git a/include/boost/type_traits/make_void.hpp b/include/boost/type_traits/make_void.hpp new file mode 100644 index 0000000..f48823b --- /dev/null +++ b/include/boost/type_traits/make_void.hpp @@ -0,0 +1,52 @@ +/* +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) +*/ + +#ifndef BOOST_TT_MAKE_VOID_HPP_INCLUDED +#define BOOST_TT_MAKE_VOID_HPP_INCLUDED + +#include + +namespace boost { + +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) +template +struct make_void { + typedef void type; +}; + +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) +template +using void_t = typename make_void::type; +#endif + +#else /* BOOST_NO_CXX11_VARIADIC_TEMPLATES */ + +template +struct make_void { + typedef void type; +}; + +#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) +template +using void_t = typename make_void::type; +#endif + +#endif + +} /* boost */ + +#endif diff --git a/test/common_type_2_test.cpp b/test/common_type_2_test.cpp index 8a4e746..114b4c2 100644 --- a/test/common_type_2_test.cpp +++ b/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/test/common_type_test.cpp b/test/common_type_test.cpp index 047b65f..3695a46 100644 --- a/test/common_type_test.cpp +++ b/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/test/is_convertible_test.cpp b/test/is_convertible_test.cpp index 40764c0..22b3201 100644 --- a/test/is_convertible_test.cpp +++ b/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/test/make_void_test.cpp b/test/make_void_test.cpp new file mode 100644 index 0000000..986cdc4 --- /dev/null +++ b/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/test/mpl_interop_test1.cpp b/test/mpl_interop_test1.cpp index 214c951..3b90418 100644 --- a/test/mpl_interop_test1.cpp +++ b/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/test/mpl_interop_test2.cpp b/test/mpl_interop_test2.cpp index 4624e0b..85805c8 100644 --- a/test/mpl_interop_test2.cpp +++ b/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/test/mpl_interop_test3.cpp b/test/mpl_interop_test3.cpp index 0a4c8ac..e89d50e 100644 --- a/test/mpl_interop_test3.cpp +++ b/test/mpl_interop_test3.cpp @@ -27,4 +27,4 @@ int main() lambda_test::type i = 0; return i; -} \ No newline at end of file +}