Boost logo

Boost-Commit :

From: tschwinger_at_[hidden]
Date: 2008-01-16 14:17:09


Author: t_schwinger
Date: 2008-01-16 14:17:09 EST (Wed, 16 Jan 2008)
New Revision: 42822
URL: http://svn.boost.org/trac/boost/changeset/42822

Log:
attempts to fix Borland regressions

Text files modified:
   trunk/boost/function_types/components.hpp | 120 +++++++++++++++++++++-------------------
   1 files changed, 63 insertions(+), 57 deletions(-)

Modified: trunk/boost/function_types/components.hpp
==============================================================================
--- trunk/boost/function_types/components.hpp (original)
+++ trunk/boost/function_types/components.hpp 2008-01-16 14:17:09 EST (Wed, 16 Jan 2008)
@@ -120,13 +120,14 @@
     template
     < typename Components
     , typename IfTagged
- , typename ThenTag
+ , typename ThenTag
+ , typename DefaultBase = components_non_func_base
>
     struct retagged_if
       : mpl::if_
         < detail::represents_impl<Components, IfTagged>
         , detail::changed_tag<Components,IfTagged,ThenTag>
- , components_non_func_base
+ , DefaultBase
>::type
     { };
 
@@ -213,14 +214,71 @@
       : components_impl<T,L>
     { };
 
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x565))
+
+ template<typename T, class C>
+ struct member_obj_ptr_result
+ { typedef T & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T, C const>
+ { typedef T const & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T, C volatile>
+ { typedef T volatile & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T, C const volatile>
+ { typedef T const volatile & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T &, C>
+ { typedef T & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T &, C const>
+ { typedef T & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T &, C volatile>
+ { typedef T & type; };
+
+ template<typename T, class C>
+ struct member_obj_ptr_result<T &, C const volatile>
+ { typedef T & type; };
+
+ template<typename T, class C, typename L>
+ struct member_obj_ptr_components
+ : member_object_pointer_base
+ {
+ typedef function_types::components<T C::*, L> type;
+ typedef components_mpl_sequence_tag tag;
+
+ typedef mpl::integral_c<std::size_t,1> function_arity;
+
+ typedef mpl::vector2< typename detail::member_obj_ptr_result<T,C>::type,
+ typename detail::class_transform<C,L>::type > types;
+ };
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x565))
+# define BOOST_FT_variations BOOST_FT_pointer|BOOST_FT_member_pointer
+
+ template<typename T, class C, typename L>
+ struct components_impl<T C::*, L>
+ : member_obj_ptr_components<T,C,L>
+ { };
+
+#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<typename T, typename C, typename L>
     struct components_impl<T C::*, L>
       : detail::retagged_if
         < detail::components_impl<typename boost::remove_cv<T>::type *, L>
- , pointer_tag, /* --> */ member_pointer_tag >
+ , pointer_tag, /* --> */ member_function_pointer_tag
+ , member_obj_ptr_components<T,C,L> >
     { };
 
     // BCC lets us test the cv-qualification of a function type by template
@@ -355,59 +413,7 @@
>::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<typename T, class C>
- struct member_obj_ptr_result
- { typedef T & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T, C const>
- { typedef T const & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T, C volatile>
- { typedef T volatile & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T, C const volatile>
- { typedef T const volatile & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T &, C>
- { typedef T & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T &, C const>
- { typedef T & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T &, C volatile>
- { typedef T & type; };
-
- template<typename T, class C>
- struct member_obj_ptr_result<T &, C const volatile>
- { typedef T & type; };
-
-
- template<typename T, class C, typename L>
- struct components_impl<T C::*, L>
- : member_object_pointer_base
- {
- typedef function_types::components<T C::*, L> type;
- typedef components_mpl_sequence_tag tag;
-
- typedef mpl::integral_c<std::size_t,1> function_arity;
-
- typedef mpl::vector2< typename detail::member_obj_ptr_result<T,C>::type,
- typename detail::class_transform<C,L>::type > types;
- };
-
-#endif
+#endif // end of BORLAND WORKAROUND
 
 #define BOOST_FT_al_path boost/function_types/detail/components_impl
 #include <boost/function_types/detail/pp_loop.hpp>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk