diff --git a/changes pending.txt b/changes pending.txt index aa50613..3c399a5 100644 --- a/changes pending.txt +++ b/changes pending.txt @@ -1,43 +1,87 @@ - -ITERATOR -~~~~~~~~ - -is_lvalue_iterator.hpp needs to include mpl/bool.hpp -https://github.com/boostorg/iterator/pull/11 - -LAMBDA -~~~~~~ - -Missing includes: -ice.hpp see https://github.com/boostorg/lambda/pull/3 -Lots of headers: https://github.com/boostorg/lambda/pull/4 - -LEXICAL_CAST -~~~~~~~~~~~ -missing is_float.hpp in converter_numeric.hpp https://github.com/boostorg/lexical_cast/pull/8 +* = PR requests not yet applied to 'develop' branch ANY ~~~ Missing mpl/if.hpp https://github.com/boostorg/any/pull/4 +DETAIL +------ + +Remove unnecessary include for deprecated ice_xxx.hpp header: https://github.com/boostorg/detail/pull/6 +Remove dependency on deprecated type_trait headers: https://github.com/boostorg/detail/pull/8 + FOREACH ~~~~~~~ Relies on conversion from integral_constant* to mpl::bool_* https://github.com/boostorg/foreach/pull/3 +FUNCTION +-------- + +Removed dependencies on ice_xxx.hpp headers: https://github.com/boostorg/function/pull/5 +Use ! operator directly rather than boost::mpl::not with Boost supported compilers: +https://github.com/boostorg/function/pull/8 + +FUNCTION_TYPES +-------------- + +Removed dependency on deprecated template_arity_spec.hpp: https://github.com/boostorg/function_types/pull/2 + GRAPH ~~~~~ -Needs to remove ice_or usage: https://github.com/boostorg/graph/pull/30 +* Needs to remove ice_or usage: https://github.com/boostorg/graph/pull/30 + +ITERATOR +~~~~~~~~ + +* is_lvalue_iterator.hpp needs to include mpl/bool.hpp +https://github.com/boostorg/iterator/pull/11 +* Removed reliance on deprecated type traits headers: https://github.com/boostorg/iterator/pull/13 + +LAMBDA +~~~~~~ + +Missing includes: +ice.hpp see https://github.com/boostorg/lambda/pull/3 +Lots of headers: https://github.com/boostorg/lambda/pull/4 +Use mpl instead of ice_ functionality: https://github.com/boostorg/lambda/pull/8 +Changes for type_traits Version2: https://github.com/boostorg/lambda/pull/9 + +LEXICAL_CAST +~~~~~~~~~~~ +missing is_float.hpp in converter_numeric.hpp https://github.com/boostorg/lexical_cast/pull/8 +Use mpl instead of ice_ functionality: https://github.com/boostorg/lexical_cast/pull/11 +Change to use operators rather than mpl equivalents for constant boolean values, in the replacements +eliminating dependency on deprecated type_traits headers: +https://github.com/boostorg/lexical_cast/pull/15 + RANDOM ~~~~~~ Missing #includes: https://github.com/boostorg/random/pull/13 +RANGE +----- +Remove dependency on type traits ice_xxx.hpp headers, which are deprecated: +https://github.com/boostorg/range/pull/27 +Use operator || rather than boost::mpl::or_ for constant boolean expression: +https://github.com/boostorg/range/pull/31 + +TEST +---- + +Add needed MPL header file: +https://github.com/boostorg/test/pull/58 + +VARIANT +------- + +Removed reliance on deprecated type_traits header: https://github.com/boostorg/variant/pull/12 Unexplained new failures ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/include/boost/type_traits/common_type.hpp b/include/boost/type_traits/common_type.hpp index 03f9bd9..194c7c4 100644 --- a/include/boost/type_traits/common_type.hpp +++ b/include/boost/type_traits/common_type.hpp @@ -42,6 +42,9 @@ #include #endif +#include +#include + //----------------------------------------------------------------------------// // // // C++03 implementation of // @@ -53,6 +56,14 @@ namespace boost { + namespace type_traits_detail { + + template + struct std_decay: boost::remove_cv< + typename boost::decay::type> {}; + + } + // prototype #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template @@ -78,7 +89,7 @@ namespace boost { { BOOST_STATIC_ASSERT_MSG(sizeof(T) > 0, "The template arguments to common_type must be complete types"); public: - typedef T type; + typedef typename type_traits_detail::std_decay::type type; }; // 2 args @@ -93,13 +104,13 @@ namespace type_traits_detail { #if !defined(BOOST_NO_CXX11_DECLTYPE) public: - typedef decltype(declval() ? declval() : declval()) type; + typedef typename std_decay() ? declval() : declval())>::type type; #elif defined(BOOST_COMMON_TYPE_USE_TYPEOF) static typename add_rvalue_reference::type declval_T(); // workaround gcc bug; not required by std static typename add_rvalue_reference::type declval_U(); // workaround gcc bug; not required by std static typename add_rvalue_reference::type declval_b(); public: - typedef __typeof__(declval_b() ? declval_T() : declval_U()) type; + typedef typename std_decay<__typeof__(declval_b() ? declval_T() : declval_U())>::type type; #elif defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) public: typedef typename detail_type_traits_common_type::common_type_impl< @@ -111,7 +122,7 @@ namespace type_traits_detail { static typename add_rvalue_reference::type declval_U(); // workaround gcc bug; not required by std static typename add_rvalue_reference::type declval_b(); public: - typedef BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U()) type; + typedef typename std_decay::type type; #endif #if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 3 @@ -123,7 +134,7 @@ namespace type_traits_detail { template struct common_type_2 { - typedef T type; + typedef typename type_traits_detail::std_decay::type type; }; } diff --git a/include/boost/type_traits/detail/bool_trait_def.hpp b/include/boost/type_traits/detail/bool_trait_def.hpp index a64cb69..b6b0677 100644 --- a/include/boost/type_traits/detail/bool_trait_def.hpp +++ b/include/boost/type_traits/detail/bool_trait_def.hpp @@ -15,7 +15,7 @@ // This header is deprecated and no longer used by type_traits: // #if defined(__GNUC__) || defined(_MSC_VER) -# pragma message("NOTE: Use of this header (ice_and.hpp) is deprecated") +# pragma message("NOTE: Use of this header (bool_trait_def.hpp) is deprecated") #endif #include diff --git a/include/boost/type_traits/detail/template_arity_spec.hpp b/include/boost/type_traits/detail/template_arity_spec.hpp index 9a728a3..36ea96d 100644 --- a/include/boost/type_traits/detail/template_arity_spec.hpp +++ b/include/boost/type_traits/detail/template_arity_spec.hpp @@ -10,7 +10,7 @@ // This header is deprecated and no longer used by type_traits: // #if defined(__GNUC__) || defined(_MSC_VER) -# pragma message("NOTE: Use of this header (ice_and.hpp) is deprecated") +# pragma message("NOTE: Use of this header (template_arity_spec.hpp) is deprecated") #endif # define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/ diff --git a/include/boost/type_traits/is_signed.hpp b/include/boost/type_traits/is_signed.hpp index 2d0afac..48facd3 100644 --- a/include/boost/type_traits/is_signed.hpp +++ b/include/boost/type_traits/is_signed.hpp @@ -64,7 +64,7 @@ struct is_signed_select_helper }; template -struct is_signed +struct is_signed_impl { typedef ::boost::detail::is_signed_select_helper< ::boost::is_integral::value || ::boost::is_enum::value> selector; typedef typename selector::template rebind binder; @@ -74,7 +74,7 @@ struct is_signed } -template struct is_signed : public integral_constant::value> {}; +template struct is_signed : public integral_constant::value> {}; #else diff --git a/test/common_type_test.cpp b/test/common_type_test.cpp index 111cbb1..047b65f 100644 --- a/test/common_type_test.cpp +++ b/test/common_type_test.cpp @@ -211,5 +211,11 @@ TT_TEST_BEGIN(common_type) #ifndef BOOST_NO_LONG_LONG BOOST_CHECK_TYPE4(tt::common_type::type, boost::long_long_type); #endif + + //changes related to defect LWG2141 + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, int); + BOOST_CHECK_TYPE3(tt::common_type::type, long); } TT_TEST_END