From 5ee20a43833ed4277a55ea7ad9cd0142c80a969a Mon Sep 17 00:00:00 2001 From: Tobias Schwinger Date: Wed, 16 Jan 2008 19:17:09 +0000 Subject: [PATCH] attempts to fix Borland regressions [SVN r42822] --- include/boost/function_types/components.hpp | 120 ++++++++++---------- 1 file changed, 63 insertions(+), 57 deletions(-) diff --git a/include/boost/function_types/components.hpp b/include/boost/function_types/components.hpp index b975307..6d503a9 100644 --- a/include/boost/function_types/components.hpp +++ b/include/boost/function_types/components.hpp @@ -120,13 +120,14 @@ namespace boost template < typename Components , typename IfTagged - , typename ThenTag + , typename ThenTag + , typename DefaultBase = components_non_func_base > struct retagged_if : mpl::if_ < detail::represents_impl , detail::changed_tag - , components_non_func_base + , DefaultBase >::type { }; @@ -213,14 +214,71 @@ namespace boost : components_impl { }; -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x565)) + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_result + { typedef T const & type; }; + + template + struct member_obj_ptr_result + { typedef T volatile & type; }; + + template + struct member_obj_ptr_result + { typedef T const volatile & type; }; + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_result + { typedef T & type; }; + + template + struct member_obj_ptr_components + : member_object_pointer_base + { + typedef function_types::components type; + typedef components_mpl_sequence_tag tag; + + typedef mpl::integral_c function_arity; + + typedef mpl::vector2< typename detail::member_obj_ptr_result::type, + typename detail::class_transform::type > types; + }; + +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x565)) +# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer + + template + struct components_impl + : member_obj_ptr_components + { }; + +#else +# define BOOST_FT_variations BOOST_FT_pointer + // This workaround removes the member pointer from the type to allow // detection of member function pointers with BCC. template struct components_impl : detail::retagged_if < detail::components_impl::type *, L> - , pointer_tag, /* --> */ member_pointer_tag > + , pointer_tag, /* --> */ member_function_pointer_tag + , member_obj_ptr_components > { }; // BCC lets us test the cv-qualification of a function type by template @@ -355,59 +413,7 @@ namespace boost >::type { }; -// TODO: add data member support for Borland - -# define BOOST_FT_variations BOOST_FT_pointer -#else // end of BORLAND WORKAROUND -# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer - - template - struct member_obj_ptr_result - { typedef T & type; }; - - template - struct member_obj_ptr_result - { typedef T const & type; }; - - template - struct member_obj_ptr_result - { typedef T volatile & type; }; - - template - struct member_obj_ptr_result - { typedef T const volatile & type; }; - - template - struct member_obj_ptr_result - { typedef T & type; }; - - template - struct member_obj_ptr_result - { typedef T & type; }; - - template - struct member_obj_ptr_result - { typedef T & type; }; - - template - struct member_obj_ptr_result - { typedef T & type; }; - - - template - struct components_impl - : member_object_pointer_base - { - typedef function_types::components type; - typedef components_mpl_sequence_tag tag; - - typedef mpl::integral_c function_arity; - - typedef mpl::vector2< typename detail::member_obj_ptr_result::type, - typename detail::class_transform::type > types; - }; - -#endif +#endif // end of BORLAND WORKAROUND #define BOOST_FT_al_path boost/function_types/detail/components_impl #include