From 59e1516609b2592c083eb78f18169d8e702b63fc Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 5 Mar 2015 11:02:19 -0500 Subject: [PATCH 1/5] This header should include the type_traits headers it needs and not depend on implicit inclusion which will go away in the current type_traits rewrite. --- include/boost/lambda/detail/return_type_traits.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/lambda/detail/return_type_traits.hpp b/include/boost/lambda/detail/return_type_traits.hpp index bf2394e..d047344 100644 --- a/include/boost/lambda/detail/return_type_traits.hpp +++ b/include/boost/lambda/detail/return_type_traits.hpp @@ -13,6 +13,7 @@ #define BOOST_LAMBDA_RETURN_TYPE_TRAITS_HPP #include "boost/mpl/has_xxx.hpp" +#include #include // needed for the ptrdiff_t From 5ba2e0aa6a4e3cd1ab18c9e153ad61ff00c658c2 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 5 Mar 2015 11:02:49 -0500 Subject: [PATCH 2/5] This file needs to include the type_traits headers it actually uses - problem exposed by ongoing type traits rewrite. --- .../boost/lambda/detail/operator_return_type_traits.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/boost/lambda/detail/operator_return_type_traits.hpp b/include/boost/lambda/detail/operator_return_type_traits.hpp index 90a35fc..6af4d03 100644 --- a/include/boost/lambda/detail/operator_return_type_traits.hpp +++ b/include/boost/lambda/detail/operator_return_type_traits.hpp @@ -12,7 +12,13 @@ #define BOOST_LAMBDA_OPERATOR_RETURN_TYPE_TRAITS_HPP #include "boost/lambda/detail/is_instance_of.hpp" -#include "boost/type_traits/same_traits.hpp" +#include "boost/type_traits/is_same.hpp" +#include "boost/type_traits/is_pointer.hpp" +#include "boost/type_traits/is_float.hpp" +#include "boost/type_traits/is_convertible.hpp" +#include "boost/type_traits/remove_pointer.hpp" +#include "boost/type_traits/remove_const.hpp" +#include "boost/type_traits/remove_reference.hpp" #include "boost/indirect_reference.hpp" #include "boost/detail/container_fwd.hpp" From 11a6698eecf323d9340a9a9857441db42684ddd8 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Tue, 31 Mar 2015 03:32:50 -0400 Subject: [PATCH 3/5] Remove ice_xxx.hpp header and change functionality to use mpl. --- .../lambda/detail/return_type_traits.hpp | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/include/boost/lambda/detail/return_type_traits.hpp b/include/boost/lambda/detail/return_type_traits.hpp index d047344..89aad92 100644 --- a/include/boost/lambda/detail/return_type_traits.hpp +++ b/include/boost/lambda/detail/return_type_traits.hpp @@ -12,18 +12,17 @@ #ifndef BOOST_LAMBDA_RETURN_TYPE_TRAITS_HPP #define BOOST_LAMBDA_RETURN_TYPE_TRAITS_HPP +#include "boost/mpl/and.hpp" #include "boost/mpl/has_xxx.hpp" -#include +#include "boost/mpl/identity.hpp" +#include "boost/mpl/not.hpp" +#include "boost/mpl/or.hpp" #include // needed for the ptrdiff_t namespace boost { namespace lambda { -using ::boost::type_traits::ice_and; -using ::boost::type_traits::ice_or; -using ::boost::type_traits::ice_not; - // Much of the type deduction code for standard arithmetic types // from Gary Powell @@ -79,7 +78,7 @@ public: typedef typename detail::IF< // is_protectable::value && is_lambda_functor::value, - ice_and::value, is_lambda_functor::value>::value, + boost::mpl::and_ >, boost::mpl::identity > >::value, lambda_functor< lambda_functor_base< Act, @@ -114,8 +113,8 @@ namespace detail { // the args tuple typedef typename detail::IF_type< // boost::is_reference::value && !boost::is_const::value, - ice_and::value, - ice_not::value>::value>::value, + boost::mpl::and_, + boost::mpl::not_ > >::value, detail::identity_mapping, const_copy_argument // handles funtion and array >::type type; // types correctly @@ -151,9 +150,9 @@ typedef typename detail::IF< // is_protectable::value && // (is_lambda_functor::value || is_lambda_functor::value), - ice_and::value, - ice_or::value, - is_lambda_functor::value>::value>::value, + boost::mpl::and_ >, + boost::mpl::or_ >, + boost::mpl::identity > > >::value, lambda_functor< lambda_functor_base< Act, @@ -190,9 +189,9 @@ typedef typename detail::IF< // is_protectable >::value && // it is protectable // (is_lambda_functor::value || is_lambda_functor::value), - ice_and >::value, // it is protectable - ice_or::value, - is_lambda_functor::value>::value>::value, + boost::mpl::and_ > >, // it is protectable + boost::mpl::or_ >, + boost::mpl::identity > > >::value, lambda_functor< lambda_functor_base< other_action, From 5e574813a2a2521d9b85992e870860a8eee055aa Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Mon, 27 Apr 2015 03:00:19 -0400 Subject: [PATCH 4/5] Simplifed using direct operators rather than mpl constructs. --- .../lambda/detail/return_type_traits.hpp | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/include/boost/lambda/detail/return_type_traits.hpp b/include/boost/lambda/detail/return_type_traits.hpp index 89aad92..da2879c 100644 --- a/include/boost/lambda/detail/return_type_traits.hpp +++ b/include/boost/lambda/detail/return_type_traits.hpp @@ -12,11 +12,7 @@ #ifndef BOOST_LAMBDA_RETURN_TYPE_TRAITS_HPP #define BOOST_LAMBDA_RETURN_TYPE_TRAITS_HPP -#include "boost/mpl/and.hpp" #include "boost/mpl/has_xxx.hpp" -#include "boost/mpl/identity.hpp" -#include "boost/mpl/not.hpp" -#include "boost/mpl/or.hpp" #include // needed for the ptrdiff_t @@ -77,8 +73,7 @@ template struct return_type_1_prot { public: typedef typename detail::IF< - // is_protectable::value && is_lambda_functor::value, - boost::mpl::and_ >, boost::mpl::identity > >::value, + is_protectable::value && is_lambda_functor::value, lambda_functor< lambda_functor_base< Act, @@ -112,9 +107,7 @@ namespace detail { // add const to rvalues, so that all rvalues are stored as const in // the args tuple typedef typename detail::IF_type< -// boost::is_reference::value && !boost::is_const::value, - boost::mpl::and_, - boost::mpl::not_ > >::value, + boost::is_reference::value && !boost::is_const::value, detail::identity_mapping, const_copy_argument // handles funtion and array >::type type; // types correctly @@ -148,11 +141,8 @@ template struct return_type_2_prot { typedef typename detail::IF< -// is_protectable::value && -// (is_lambda_functor::value || is_lambda_functor::value), - boost::mpl::and_ >, - boost::mpl::or_ >, - boost::mpl::identity > > >::value, + is_protectable::value && + (is_lambda_functor::value || is_lambda_functor::value), lambda_functor< lambda_functor_base< Act, @@ -187,11 +177,8 @@ struct return_type_2_comma typedef typename detail::IF< -// is_protectable >::value && // it is protectable -// (is_lambda_functor::value || is_lambda_functor::value), - boost::mpl::and_ > >, // it is protectable - boost::mpl::or_ >, - boost::mpl::identity > > >::value, + is_protectable >::value && // it is protectable + (is_lambda_functor::value || is_lambda_functor::value), lambda_functor< lambda_functor_base< other_action, From 9a581dafb722f5ad93b21b653f1df7325ce0ba86 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Wed, 6 May 2015 16:23:39 -0400 Subject: [PATCH 5/5] Added 'void const' specialization to fix problem with clang --- include/boost/lambda/detail/lambda_traits.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/lambda/detail/lambda_traits.hpp b/include/boost/lambda/detail/lambda_traits.hpp index f35fa09..cae0f38 100644 --- a/include/boost/lambda/detail/lambda_traits.hpp +++ b/include/boost/lambda/detail/lambda_traits.hpp @@ -282,6 +282,11 @@ struct const_copy_argument { typedef void type; }; +template<> +struct const_copy_argument { + typedef void type; +}; + // Does the same as const_copy_argument, but passes references through as such template