From 58c27a4f0c55b67fcb6e64ed6a3c2a46c31cf27a Mon Sep 17 00:00:00 2001 From: mat007 Date: Sat, 26 Apr 2014 07:05:53 +0000 Subject: [PATCH] Removed obsolete BOOST_DEDUCED_TYPENAME git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@716 860be788-9bd5-4423-9f1e-828f051e677b --- turtle/constraint.hpp | 2 +- turtle/constraints.hpp | 16 ++++++------- turtle/detail/action.hpp | 12 +++++----- turtle/detail/function_impl_template.hpp | 3 +-- turtle/detail/function_template.hpp | 7 +++--- turtle/detail/lambda.hpp | 3 +-- turtle/detail/parameter.hpp | 4 ++-- turtle/detail/signature.hpp | 6 ++--- turtle/log.hpp | 4 ++-- turtle/matcher.hpp | 2 +- turtle/mock.hpp | 30 ++++++++++++------------ turtle/object.hpp | 4 ++-- 12 files changed, 45 insertions(+), 48 deletions(-) diff --git a/turtle/constraint.hpp b/turtle/constraint.hpp index 4b0154c..b30a469 100644 --- a/turtle/constraint.hpp +++ b/turtle/constraint.hpp @@ -157,7 +157,7 @@ namespace detail Expected_##n expected##n; #define MOCK_CONSTRAINT_CREF_PARAM(z, n, Args) \ - BOOST_DEDUCED_TYPENAME \ + typename \ boost::unwrap_reference< Expected_##n >::type \ BOOST_PP_ARRAY_ELEM(n, Args) diff --git a/turtle/constraints.hpp b/turtle/constraints.hpp index 40ded8e..f74eeca 100644 --- a/turtle/constraints.hpp +++ b/turtle/constraints.hpp @@ -76,7 +76,7 @@ namespace detail { return os << "same( " << mock::format( *s.expected_ ) << " )"; } - const BOOST_DEDUCED_TYPENAME + const typename boost::unwrap_reference< Expected >::type* expected_; }; @@ -88,10 +88,10 @@ namespace detail {} template< typename Actual > bool operator()( const Actual& actual, - BOOST_DEDUCED_TYPENAME boost::disable_if< + typename boost::disable_if< boost::is_convertible< const Actual*, - BOOST_DEDUCED_TYPENAME + typename boost::unwrap_reference< Expected >::type > >::type* = 0 ) const @@ -101,9 +101,9 @@ namespace detail } template< typename Actual > bool operator()( Actual& actual, - BOOST_DEDUCED_TYPENAME boost::enable_if< + typename boost::enable_if< boost::is_convertible< Actual*, - BOOST_DEDUCED_TYPENAME + typename boost::unwrap_reference< Expected >::type > >::type* = 0 ) const @@ -115,7 +115,7 @@ namespace detail { return s << "retrieve( " << mock::format( *r.expected_ ) << " )"; } - BOOST_DEDUCED_TYPENAME + typename boost::unwrap_reference< Expected >::type* expected_; }; @@ -133,9 +133,9 @@ namespace detail } template< typename Actual > bool operator()( Actual* actual, - BOOST_DEDUCED_TYPENAME boost::enable_if< + typename boost::enable_if< boost::is_convertible< - BOOST_DEDUCED_TYPENAME + typename boost::unwrap_reference< Expected >::type, Actual > diff --git a/turtle/detail/action.hpp b/turtle/detail/action.hpp index ff74d0c..321d359 100644 --- a/turtle/detail/action.hpp +++ b/turtle/detail/action.hpp @@ -60,11 +60,11 @@ namespace detail template< typename Result, typename Signature > class action { - typedef BOOST_DEDUCED_TYPENAME + typedef typename boost::function< Signature > functor_type; - typedef BOOST_DEDUCED_TYPENAME + typedef typename boost::remove_reference< - BOOST_DEDUCED_TYPENAME boost::remove_const< Result >::type + typename boost::remove_const< Result >::type >::type result_type; typedef lambda< Result, Signature > lambda_type; @@ -119,7 +119,7 @@ namespace detail template< typename Result, typename Signature > class action< Result*, Signature > { - typedef BOOST_DEDUCED_TYPENAME + typedef typename boost::function< Signature > functor_type; typedef lambda< Result*, Signature > lambda_type; @@ -160,7 +160,7 @@ namespace detail template< typename Signature > class action< void, Signature > { - typedef BOOST_DEDUCED_TYPENAME + typedef typename boost::function< Signature > functor_type; typedef lambda< void, Signature > lambda_type; @@ -195,7 +195,7 @@ namespace detail template< typename Result, typename Signature > class action< std::auto_ptr< Result >, Signature > { - typedef BOOST_DEDUCED_TYPENAME + typedef typename boost::function< Signature > functor_type; typedef lambda< std::auto_ptr< Result >, Signature > lambda_type; diff --git a/turtle/detail/function_impl_template.hpp b/turtle/detail/function_impl_template.hpp index ed48581..bede0c8 100644 --- a/turtle/detail/function_impl_template.hpp +++ b/turtle/detail/function_impl_template.hpp @@ -167,8 +167,7 @@ namespace detail }; typedef std::list< expectation_type > expectations_type; - typedef BOOST_DEDUCED_TYPENAME - expectations_type::const_iterator expectations_cit; + typedef typename expectations_type::const_iterator expectations_cit; expectations_type expectations_; context* context_; diff --git a/turtle/detail/function_template.hpp b/turtle/detail/function_template.hpp index a517191..1b59ee3 100644 --- a/turtle/detail/function_template.hpp +++ b/turtle/detail/function_template.hpp @@ -9,7 +9,7 @@ #include "function_impl_template.hpp" #define MOCK_FUNCTION_CALL(z, n, d ) \ - BOOST_PP_COMMA_IF(n) BOOST_DEDUCED_TYPENAME \ + BOOST_PP_COMMA_IF(n) typename \ boost::call_traits< T##n >::param_type #define MOCK_FUNCTION_PARAM(z, n, d) \ @@ -38,9 +38,8 @@ namespace detail typedef function_impl< R ( BOOST_PP_REPEAT(MOCK_NUM_ARGS, MOCK_FUNCTION_CALL, _) ) > impl_type; - typedef BOOST_DEDUCED_TYPENAME - impl_type::expectation_type expectation_type; - typedef BOOST_DEDUCED_TYPENAME impl_type::error_type error_type; + typedef typename impl_type::expectation_type expectation_type; + typedef typename impl_type::error_type error_type; public: function() diff --git a/turtle/detail/lambda.hpp b/turtle/detail/lambda.hpp index 19d62c0..e805ab6 100644 --- a/turtle/detail/lambda.hpp +++ b/turtle/detail/lambda.hpp @@ -31,8 +31,7 @@ namespace detail template< typename Result, typename Signature > struct lambda { - typedef BOOST_DEDUCED_TYPENAME - boost::function< Signature > functor_type; + typedef boost::function< Signature > functor_type; template< typename T > static functor_type make_val( T t ) diff --git a/turtle/detail/parameter.hpp b/turtle/detail/parameter.hpp index 761eccd..2135fd2 100644 --- a/turtle/detail/parameter.hpp +++ b/turtle/detail/parameter.hpp @@ -21,9 +21,9 @@ namespace detail template< typename Signature, int n > struct parameter { - typedef BOOST_DEDUCED_TYPENAME + typedef typename boost::mpl::at_c< - BOOST_DEDUCED_TYPENAME + typename boost::function_types::parameter_types< Signature >, n >::type type; diff --git a/turtle/detail/signature.hpp b/turtle/detail/signature.hpp index 42d1e63..796e70f 100644 --- a/turtle/detail/signature.hpp +++ b/turtle/detail/signature.hpp @@ -28,11 +28,11 @@ namespace detail boost::function_types::function_type< boost::mpl::joint_view< boost::mpl::single_view< - BOOST_DEDUCED_TYPENAME + typename boost::function_types::result_type< M >::type >, - BOOST_DEDUCED_TYPENAME boost::mpl::pop_front< - BOOST_DEDUCED_TYPENAME + typename boost::mpl::pop_front< + typename boost::function_types::parameter_types< M > >::type > diff --git a/turtle/log.hpp b/turtle/log.hpp index 4207eb5..678b78f 100644 --- a/turtle/log.hpp +++ b/turtle/log.hpp @@ -165,7 +165,7 @@ namespace detail #endif template< typename T > - BOOST_DEDUCED_TYPENAME boost::enable_if< + typename boost::enable_if< boost::function_types::is_callable_builtin< T >, stream& >::type @@ -174,7 +174,7 @@ namespace detail return s << '?'; } template< typename T > - BOOST_DEDUCED_TYPENAME boost::disable_if< + typename boost::disable_if< boost::function_types::is_callable_builtin< T >, stream& >::type diff --git a/turtle/matcher.hpp b/turtle/matcher.hpp index ba5038e..be5d379 100644 --- a/turtle/matcher.hpp +++ b/turtle/matcher.hpp @@ -84,7 +84,7 @@ namespace mock template< typename Actual, typename Functor > class matcher< Actual, Functor, - BOOST_DEDUCED_TYPENAME boost::enable_if< + typename boost::enable_if< detail::is_functor< Functor, Actual > >::type > : public detail::matcher_base< Actual > diff --git a/turtle/mock.hpp b/turtle/mock.hpp index 7980086..b0c7816 100644 --- a/turtle/mock.hpp +++ b/turtle/mock.hpp @@ -39,7 +39,7 @@ mock::detail::functor< MOCK_FUNCTION_TYPE((__VA_ARGS__),) > f, f##_mock #define MOCK_FUNCTOR_TPL(f, ...) \ mock::detail::functor< \ - MOCK_FUNCTION_TYPE((__VA_ARGS__), BOOST_DEDUCED_TYPENAME) > f, f##_mock + MOCK_FUNCTION_TYPE((__VA_ARGS__), typename) > f, f##_mock #else // MOCK_VARIADIC_MACROS @@ -50,7 +50,7 @@ mock::detail::functor< MOCK_FUNCTION_TYPE(S,) > f, f##_mock #define MOCK_FUNCTOR_TPL(f, S) \ mock::detail::functor< \ - MOCK_FUNCTION_TYPE(S, BOOST_DEDUCED_TYPENAME) > f, f##_mock + MOCK_FUNCTION_TYPE(S, typename) > f, f##_mock #endif // MOCK_VARIADIC_MACROS @@ -104,15 +104,15 @@ MOCK_METHOD_HELPER(S, t,) #define MOCK_METHOD_EXT_TPL(M, n, S, t) \ - MOCK_METHOD_AUX(M, n, S, t,, BOOST_DEDUCED_TYPENAME) \ - MOCK_METHOD_AUX(M, n, S, t, const, BOOST_DEDUCED_TYPENAME) \ - MOCK_METHOD_HELPER(S, t, BOOST_DEDUCED_TYPENAME) + MOCK_METHOD_AUX(M, n, S, t,, typename) \ + MOCK_METHOD_AUX(M, n, S, t, const, typename) \ + MOCK_METHOD_HELPER(S, t, typename) #define MOCK_CONST_METHOD_EXT_TPL(M, n, S, t) \ - MOCK_METHOD_AUX(M, n, S, t, const, BOOST_DEDUCED_TYPENAME) \ - MOCK_METHOD_HELPER(S, t, BOOST_DEDUCED_TYPENAME) + MOCK_METHOD_AUX(M, n, S, t, const, typename) \ + MOCK_METHOD_HELPER(S, t, typename) #define MOCK_NON_CONST_METHOD_EXT_TPL(M, n, S, t) \ - MOCK_METHOD_AUX(M, n, S, t,, BOOST_DEDUCED_TYPENAME) \ - MOCK_METHOD_HELPER(S, t, BOOST_DEDUCED_TYPENAME) + MOCK_METHOD_AUX(M, n, S, t,, typename) \ + MOCK_METHOD_HELPER(S, t, typename) #define MOCK_CONVERSION_OPERATOR(M, T, t) \ M T() const { return MOCK_ANONYMOUS_HELPER(t)(); } \ @@ -128,13 +128,13 @@ #define MOCK_CONVERSION_OPERATOR_TPL(M, T, t) \ M T() const { return MOCK_ANONYMOUS_HELPER(t)(); } \ M T() { return MOCK_ANONYMOUS_HELPER(t)(); } \ - MOCK_METHOD_HELPER(T(), t, BOOST_DEDUCED_TYPENAME) + MOCK_METHOD_HELPER(T(), t, typename) #define MOCK_CONST_CONVERSION_OPERATOR_TPL(M, T, t) \ M T() const { return MOCK_ANONYMOUS_HELPER(t)(); } \ - MOCK_METHOD_HELPER(T(), t, BOOST_DEDUCED_TYPENAME) + MOCK_METHOD_HELPER(T(), t, typename) #define MOCK_NON_CONST_CONVERSION_OPERATOR_TPL(M, T, t) \ M T() { return MOCK_ANONYMOUS_HELPER(t)(); } \ - MOCK_METHOD_HELPER(T(), t, BOOST_DEDUCED_TYPENAME) + MOCK_METHOD_HELPER(T(), t, typename) #define MOCK_FUNCTION_HELPER(S, t, s, tpn) \ s mock::detail::function< MOCK_FUNCTION_TYPE(S, tpn) >& t##_mock( \ @@ -155,7 +155,7 @@ #define MOCK_CONSTRUCTOR(T, n, A, t) \ MOCK_CONSTRUCTOR_AUX(T, n, A, t,) #define MOCK_CONSTRUCTOR_TPL(T, n, A, t) \ - MOCK_CONSTRUCTOR_AUX(T, n, A, t, BOOST_DEDUCED_TYPENAME) + MOCK_CONSTRUCTOR_AUX(T, n, A, t, typename) #define MOCK_DESTRUCTOR(T, t) \ T() { try { MOCK_ANONYMOUS_HELPER(t)(); } catch( ... ) {} } \ @@ -218,7 +218,7 @@ MOCK_FUNCTION_AUX(F, n, \ MOCK_VARIADIC_ELEM_0(__VA_ARGS__), \ MOCK_VARIADIC_ELEM_1(__VA_ARGS__, F), \ - static, BOOST_DEDUCED_TYPENAME) + static, typename) #else // MOCK_VARIADIC_MACROS @@ -231,7 +231,7 @@ #define MOCK_STATIC_METHOD(F, n, S, t) \ MOCK_FUNCTION_AUX(F, n, S, t, static,) #define MOCK_STATIC_METHOD_TPL(F, n, S, t) \ - MOCK_FUNCTION_AUX(F, n, S, t, static, BOOST_DEDUCED_TYPENAME) + MOCK_FUNCTION_AUX(F, n, S, t, static, typename) #endif // MOCK_VARIADIC_MACROS diff --git a/turtle/object.hpp b/turtle/object.hpp index 789367b..609637e 100644 --- a/turtle/object.hpp +++ b/turtle/object.hpp @@ -36,8 +36,8 @@ namespace detail boost::unit_test::const_string instance, boost::optional< type_name > type, boost::unit_test::const_string name, - BOOST_DEDUCED_TYPENAME boost::disable_if< - BOOST_DEDUCED_TYPENAME boost::is_base_of< object, T > + typename boost::disable_if< + typename boost::is_base_of< object, T > >::type* = 0 ) { e.configure( detail::root, &t, instance, type, name );