From 74c9cc968086e25b6b63342528dd8f3e7f13fa2d Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 30 Mar 2015 01:47:08 -0400 Subject: [PATCH 1/5] Remove dependency on deprecated type_traits headers. --- include/boost/function/function_base.hpp | 11 +++--- include/boost/function/function_template.hpp | 36 ++++++++++---------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 9e01ef9..200da07 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -25,9 +25,10 @@ #include #include #include -#include #include #include +#include +#include #include #include #ifndef BOOST_NO_SFINAE @@ -74,15 +75,15 @@ #if !BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) # define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ - typename ::boost::enable_if_c<(::boost::type_traits::ice_not< \ - (::boost::is_integral::value)>::value), \ + typename ::boost::enable_if >::type, \ Type>::type #else // BCC doesn't recognize this depends on a template argument and complains // about the use of 'typename' # define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ - ::boost::enable_if_c<(::boost::type_traits::ice_not< \ - (::boost::is_integral::value)>::value), \ + ::boost::enable_if<::boost::mpl::not_< \ + ::boost::is_integral >::type, \ Type>::type #endif diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index ab7abc5..3d5fdab 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -717,9 +717,9 @@ namespace boost { template BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f #ifndef BOOST_NO_SFINAE - ,typename enable_if_c< - (boost::type_traits::ice_not< - (is_integral::value)>::value), + ,typename enable_if< + typename boost::mpl::not_< + is_integral >::type, int>::type = 0 #endif // BOOST_NO_SFINAE ) : @@ -730,9 +730,9 @@ namespace boost { template BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a #ifndef BOOST_NO_SFINAE - ,typename enable_if_c< - (boost::type_traits::ice_not< - (is_integral::value)>::value), + ,typename enable_if< + typename boost::mpl::not_< + is_integral >::type, int>::type = 0 #endif // BOOST_NO_SFINAE ) : @@ -780,9 +780,9 @@ namespace boost { // construct. template #ifndef BOOST_NO_SFINAE - typename enable_if_c< - (boost::type_traits::ice_not< - (is_integral::value)>::value), + typename enable_if< + typename boost::mpl::not_< + is_integral >::type, BOOST_FUNCTION_FUNCTION&>::type #else BOOST_FUNCTION_FUNCTION& @@ -1068,9 +1068,9 @@ public: template function(Functor f #ifndef BOOST_NO_SFINAE - ,typename enable_if_c< - (boost::type_traits::ice_not< - (is_integral::value)>::value), + ,typename enable_if< + typename boost::mpl::not_< + is_integral >::type, int>::type = 0 #endif ) : @@ -1080,9 +1080,9 @@ public: template function(Functor f, Allocator a #ifndef BOOST_NO_SFINAE - ,typename enable_if_c< - (boost::type_traits::ice_not< - (is_integral::value)>::value), + ,typename enable_if< + typename boost::mpl::not_< + is_integral >::type, int>::type = 0 #endif ) : @@ -1120,9 +1120,9 @@ public: template #ifndef BOOST_NO_SFINAE - typename enable_if_c< - (boost::type_traits::ice_not< - (is_integral::value)>::value), + typename enable_if< + typename boost::mpl::not_< + is_integral >::type, self_type&>::type #else self_type& From 8cc1be159b81be7a66cfaced3b50072187236778 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 2 Apr 2015 07:15:26 -0400 Subject: [PATCH 2/5] Removed unnecessary header file include --- include/boost/function/function_base.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 200da07..9ddff20 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include From 73e4d02b00ed165988478bf958ad72c46ec70837 Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Fri, 3 Apr 2015 08:55:01 +0200 Subject: [PATCH 3/5] Qualify enable_if with namespace boost Unfortunately the change from enable_if_c to enable_if in 74c9cc968086e25b6b63342528dd8f3e7f13fa2d broke a lot of other libraries' regression tests on MSVC, which complains about ambiguous symbols. --- include/boost/function/function_template.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 3d5fdab..8aa1579 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -717,7 +717,7 @@ namespace boost { template BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f #ifndef BOOST_NO_SFINAE - ,typename enable_if< + ,typename boost::enable_if< typename boost::mpl::not_< is_integral >::type, int>::type = 0 @@ -730,7 +730,7 @@ namespace boost { template BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a #ifndef BOOST_NO_SFINAE - ,typename enable_if< + ,typename boost::enable_if< typename boost::mpl::not_< is_integral >::type, int>::type = 0 @@ -780,7 +780,7 @@ namespace boost { // construct. template #ifndef BOOST_NO_SFINAE - typename enable_if< + typename boost::enable_if< typename boost::mpl::not_< is_integral >::type, BOOST_FUNCTION_FUNCTION&>::type @@ -1068,7 +1068,7 @@ public: template function(Functor f #ifndef BOOST_NO_SFINAE - ,typename enable_if< + ,typename boost::enable_if< typename boost::mpl::not_< is_integral >::type, int>::type = 0 @@ -1080,7 +1080,7 @@ public: template function(Functor f, Allocator a #ifndef BOOST_NO_SFINAE - ,typename enable_if< + ,typename boost::enable_if< typename boost::mpl::not_< is_integral >::type, int>::type = 0 @@ -1120,7 +1120,7 @@ public: template #ifndef BOOST_NO_SFINAE - typename enable_if< + typename boost::enable_if< typename boost::mpl::not_< is_integral >::type, self_type&>::type From f0ec326eb089326d2b03ea72537df1f7bef83919 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 27 Apr 2015 04:15:31 -0400 Subject: [PATCH 4/5] Use ! operator directly rather than boost::mpl::not with Boost supported compilers. --- include/boost/function/function_base.hpp | 9 +++--- include/boost/function/function_template.hpp | 30 ++++++++------------ 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 9ddff20..5143465 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #ifndef BOOST_NO_SFINAE @@ -74,15 +73,15 @@ #if !BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) # define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ - typename ::boost::enable_if >::type, \ + typename ::boost::enable_if_c< \ + !(::boost::is_integral::value), \ Type>::type #else // BCC doesn't recognize this depends on a template argument and complains // about the use of 'typename' # define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ - ::boost::enable_if<::boost::mpl::not_< \ - ::boost::is_integral >::type, \ + ::boost::enable_if_c< \ + !(::boost::is_integral::value), \ Type>::type #endif diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index 8aa1579..211b81d 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -717,9 +717,8 @@ namespace boost { template BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f #ifndef BOOST_NO_SFINAE - ,typename boost::enable_if< - typename boost::mpl::not_< - is_integral >::type, + ,typename boost::enable_if_c< + !(is_integral::value), int>::type = 0 #endif // BOOST_NO_SFINAE ) : @@ -730,9 +729,8 @@ namespace boost { template BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a #ifndef BOOST_NO_SFINAE - ,typename boost::enable_if< - typename boost::mpl::not_< - is_integral >::type, + ,typename boost::enable_if_c< + !(is_integral::value), int>::type = 0 #endif // BOOST_NO_SFINAE ) : @@ -780,9 +778,8 @@ namespace boost { // construct. template #ifndef BOOST_NO_SFINAE - typename boost::enable_if< - typename boost::mpl::not_< - is_integral >::type, + typename boost::enable_if_c< + !(is_integral::value), BOOST_FUNCTION_FUNCTION&>::type #else BOOST_FUNCTION_FUNCTION& @@ -1068,9 +1065,8 @@ public: template function(Functor f #ifndef BOOST_NO_SFINAE - ,typename boost::enable_if< - typename boost::mpl::not_< - is_integral >::type, + ,typename boost::enable_if_c< + !(is_integral::value), int>::type = 0 #endif ) : @@ -1080,9 +1076,8 @@ public: template function(Functor f, Allocator a #ifndef BOOST_NO_SFINAE - ,typename boost::enable_if< - typename boost::mpl::not_< - is_integral >::type, + ,typename boost::enable_if_c< + !(is_integral::value), int>::type = 0 #endif ) : @@ -1120,9 +1115,8 @@ public: template #ifndef BOOST_NO_SFINAE - typename boost::enable_if< - typename boost::mpl::not_< - is_integral >::type, + typename boost::enable_if_c< + !(is_integral::value), self_type&>::type #else self_type& From 0c467707d9f9b21bfc7dae5dfcd0ee31d131f1cb Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 27 Apr 2015 14:43:49 -0400 Subject: [PATCH 5/5] Remove Borland workaround for obsolete and untested compiler/version. --- include/boost/function/function_base.hpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 5143465..35c1995 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -71,19 +71,10 @@ # define BOOST_FUNCTION_TARGET_FIX(x) #endif // __ICL etc -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) # define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ typename ::boost::enable_if_c< \ !(::boost::is_integral::value), \ Type>::type -#else -// BCC doesn't recognize this depends on a template argument and complains -// about the use of 'typename' -# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \ - ::boost::enable_if_c< \ - !(::boost::is_integral::value), \ - Type>::type -#endif namespace boost { namespace detail {