Merge branch 'Version2' of https://github.com/boostorg/type_traits into Version2

This commit is contained in:
jzmaddock
2015-05-21 18:52:13 +01:00
6 changed files with 88 additions and 27 deletions

View File

@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -42,6 +42,9 @@
#include <boost/type_traits/add_rvalue_reference.hpp>
#endif
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/decay.hpp>
//----------------------------------------------------------------------------//
// //
// C++03 implementation of //
@@ -53,6 +56,14 @@
namespace boost {
namespace type_traits_detail {
template <class T>
struct std_decay: boost::remove_cv<
typename boost::decay<T>::type> {};
}
// prototype
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<typename... T>
@@ -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<T>::type type;
};
// 2 args
@@ -93,13 +104,13 @@ namespace type_traits_detail {
#if !defined(BOOST_NO_CXX11_DECLTYPE)
public:
typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type;
typedef typename std_decay<decltype(declval<bool>() ? declval<T>() : declval<U>())>::type type;
#elif defined(BOOST_COMMON_TYPE_USE_TYPEOF)
static typename add_rvalue_reference<T>::type declval_T(); // workaround gcc bug; not required by std
static typename add_rvalue_reference<U>::type declval_U(); // workaround gcc bug; not required by std
static typename add_rvalue_reference<bool>::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<U>::type declval_U(); // workaround gcc bug; not required by std
static typename add_rvalue_reference<bool>::type declval_b();
public:
typedef BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U()) type;
typedef typename std_decay<BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U())>::type type;
#endif
#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 3
@@ -123,7 +134,7 @@ namespace type_traits_detail {
template <class T>
struct common_type_2<T, T>
{
typedef T type;
typedef typename type_traits_detail::std_decay<T>::type type;
};
}

View File

@@ -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 <boost/type_traits/detail/template_arity_spec.hpp>

View File

@@ -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) /**/

View File

@@ -64,7 +64,7 @@ struct is_signed_select_helper<false>
};
template <class T>
struct is_signed
struct is_signed_impl
{
typedef ::boost::detail::is_signed_select_helper< ::boost::is_integral<T>::value || ::boost::is_enum<T>::value> selector;
typedef typename selector::template rebind<T> binder;
@@ -74,7 +74,7 @@ struct is_signed
}
template <class T> struct is_signed : public integral_constant<bool, boost::detail::is_signed<T>::value> {};
template <class T> struct is_signed : public integral_constant<bool, boost::detail::is_signed_impl<T>::value> {};
#else

View File

@@ -211,5 +211,11 @@ TT_TEST_BEGIN(common_type)
#ifndef BOOST_NO_LONG_LONG
BOOST_CHECK_TYPE4(tt::common_type<unsigned, char, boost::long_long_type>::type, boost::long_long_type);
#endif
//changes related to defect LWG2141
BOOST_CHECK_TYPE(tt::common_type<int&>::type, int);
BOOST_CHECK_TYPE(tt::common_type<const int>::type, int);
BOOST_CHECK_TYPE3(tt::common_type<const int, const int>::type, int);
BOOST_CHECK_TYPE3(tt::common_type<const int, const long>::type, long);
}
TT_TEST_END