diff --git a/doc/conditional.qbk b/doc/conditional.qbk index a4b867e..edb7645 100644 --- a/doc/conditional.qbk +++ b/doc/conditional.qbk @@ -16,7 +16,7 @@ __header ` #include ` or ` #include struct __conditional; } -If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal F. +If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal U. This trait is really just an alias for `boost::mpl::if_c`. diff --git a/doc/html/boost_typetraits/reference/conditional.html b/doc/html/boost_typetraits/reference/conditional.html index 3977fc6..9780917 100644 --- a/doc/html/boost_typetraits/reference/conditional.html +++ b/doc/html/boost_typetraits/reference/conditional.html @@ -37,7 +37,7 @@

If B is true, the member typedef type shall equal T. If B is false, the member - typedef type shall equal F. + typedef type shall equal U.

This trait is really just an alias for boost::mpl::if_c. diff --git a/doc/html/boost_typetraits/reference/is_union.html b/doc/html/boost_typetraits/reference/is_union.html index f255b36..f8b2d8e 100644 --- a/doc/html/boost_typetraits/reference/is_union.html +++ b/doc/html/boost_typetraits/reference/is_union.html @@ -62,20 +62,24 @@

Examples:

+

+ Given union my_union + {}; then: +

- is_union<void> + is_union<my_union> inherits from true_type.

- is_union<const void>::type + is_union<const my_union>::type is the type true_type.

- is_union<void>::value is an integral constant expression + is_union<my_union>::value is an integral constant expression that evaluates to true.

- is_union<void*>::value is an integral constant expression + is_union<my_union*>::value is an integral constant expression that evaluates to false.

diff --git a/doc/html/index.html b/doc/html/index.html index 4668253..54193c1 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -30,7 +30,7 @@ Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten Ottosen, Robert Ramey and Jeremy Siek

-

+

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)

diff --git a/doc/html/index/s11.html b/doc/html/index/s11.html index e8737a2..75d22d0 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 P R T

diff --git a/doc/html/index/s12.html b/doc/html/index/s12.html index 72b079c..c097111 100644 --- a/doc/html/index/s12.html +++ b/doc/html/index/s12.html @@ -24,7 +24,7 @@

-Typedef Index

+Typedef Index

F R T

diff --git a/doc/html/index/s13.html b/doc/html/index/s13.html index 15de3c1..57efc89 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 22200c3..22a6d6e 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 P R T U

diff --git a/doc/is_union.qbk b/doc/is_union.qbk index 9d8cd8f..e8203b7 100644 --- a/doc/is_union.qbk +++ b/doc/is_union.qbk @@ -30,14 +30,16 @@ __header ` #include ` or ` #include ` inherits from `__true_type`.] +Given `union my_union {};` then: -[:`is_union::type` is the type `__true_type`.] +[:`is_union` inherits from `__true_type`.] -[:`is_union::value` is an integral constant +[:`is_union::type` is the type `__true_type`.] + +[:`is_union::value` is an integral constant expression that evaluates to /true/.] -[:`is_union::value` is an integral constant +[:`is_union::value` is an integral constant expression that evaluates to /false/.] [:`is_union::value_type` is the type `bool`.] diff --git a/include/boost/type_traits/intrinsics.hpp b/include/boost/type_traits/intrinsics.hpp index 796317d..d47b33e 100644 --- a/include/boost/type_traits/intrinsics.hpp +++ b/include/boost/type_traits/intrinsics.hpp @@ -1,4 +1,3 @@ - // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -124,6 +123,68 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif +#if defined(BOOST_CLANG) && defined(__has_feature) +# include +# include +# include + +# if __has_feature(is_union) +# define BOOST_IS_UNION(T) __is_union(T) +# endif +# if __has_feature(is_pod) && defined(_LIBCPP_VERSION) +# define BOOST_IS_POD(T) __is_pod(T) +# endif +# if __has_feature(is_empty) && defined(_LIBCPP_VERSION) +# define BOOST_IS_EMPTY(T) __is_empty(T) +# endif +# if __has_feature(has_trivial_constructor) +# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) +# endif +# if __has_feature(has_trivial_copy) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value && !is_volatile::value) +# endif +# if __has_feature(has_trivial_assign) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value) +# endif +# if __has_feature(has_trivial_destructor) +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) +# endif +# if __has_feature(has_nothrow_constructor) +# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T) +# endif +# if __has_feature(has_nothrow_copy) +# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile::value && !is_reference::value) +# endif +# if __has_feature(has_nothrow_assign) +# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile::value) +# endif +# if __has_feature(has_virtual_destructor) +# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) +# endif +# if __has_feature(is_abstract) +# define BOOST_IS_ABSTRACT(T) __is_abstract(T) +# endif +# if __has_feature(is_base_of) +# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same::value) +# endif +# if __has_feature(is_class) +# define BOOST_IS_CLASS(T) __is_class(T) +# endif +# if __has_feature(is_convertible_to) +# include +# define BOOST_IS_CONVERTIBLE(T,U) (__is_convertible_to(T,U) && !::boost::is_abstract::value) +# endif +# if __has_feature(is_enum) +# define BOOST_IS_ENUM(T) __is_enum(T) +# endif +# if __has_feature(is_polymorphic) +# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) +# endif +# define BOOST_ALIGNMENT_OF(T) __alignof(T) + +# define BOOST_HAS_TYPE_TRAITS_INTRINSICS +#endif + #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) # include # include @@ -224,3 +285,4 @@ +