diff --git a/example/fast_mem_fn_example.cpp b/example/fast_mem_fn_example.cpp index efe66a1..381ee14 100644 --- a/example/fast_mem_fn_example.cpp +++ b/example/fast_mem_fn_example.cpp @@ -101,7 +101,11 @@ int main() setup_test(v); t.restart(); +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1400) do_test(v, BOOST_EXAMPLE_FAST_MEM_FN(& test::id)); +#else // MSVC<8 does not like the implementation of the deduction macro: + do_test(v, ::example::fast_mem_fn< int (test::*)() const, & test::id >()); +#endif time1 = t.elapsed(); std::cout << "fast_mem_fn | " << time1 << std::endl; diff --git a/example/interface_example.cpp b/example/interface_example.cpp index d4f66bb..6b7f8d9 100644 --- a/example/interface_example.cpp +++ b/example/interface_example.cpp @@ -8,6 +8,7 @@ // See interface.hpp in this directory for details. #include +#include #include "interface.hpp" diff --git a/example/interpreter.hpp b/example/interpreter.hpp index 65521b8..72cd78b 100644 --- a/example/interpreter.hpp +++ b/example/interpreter.hpp @@ -135,7 +135,7 @@ namespace example typedef typename mpl::deref::type arg_type; typedef typename mpl::next::type next_iter_type; - invoker::apply + interpreter::invoker::apply ( func, parser, fusion::push_back(args, parser.get()) ); } }; diff --git a/include/boost/function_types/components.hpp b/include/boost/function_types/components.hpp index b975307..a4432c5 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 @@ -349,65 +407,13 @@ namespace boost struct components_bcc : mpl::if_ < detail::represents_impl< detail::components_impl - , member_pointer_tag> + , member_function_pointer_tag> , detail::mfp_components,T,OrigT,L> , detail::components_impl >::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 diff --git a/include/boost/function_types/detail/cv_traits.hpp b/include/boost/function_types/detail/cv_traits.hpp index b48452d..e52a48d 100644 --- a/include/boost/function_types/detail/cv_traits.hpp +++ b/include/boost/function_types/detail/cv_traits.hpp @@ -12,7 +12,7 @@ #include #include -#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || BOOST_WORKAROUND(__BORLANDC__, <= 0x582) # include # include # include @@ -25,7 +25,7 @@ namespace boost { namespace function_types { namespace detail { namespace ft = boost::function_types; -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, <= 0x582) template struct cv_traits { typedef non_cv tag; typedef T type; };