From 3c0c2b8513cc65425941e0eba0f99e734351fea2 Mon Sep 17 00:00:00 2001 From: Thomas Witt Date: Tue, 1 Jul 2003 18:47:43 +0000 Subject: [PATCH] Improved portability. [SVN r1397] --- include/boost/iterator/transform_iterator.hpp | 13 ++++++++++++- test/transform_iterator_test.cpp | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp index 77fa9bc..c996038 100644 --- a/include/boost/iterator/transform_iterator.hpp +++ b/include/boost/iterator/transform_iterator.hpp @@ -125,6 +125,10 @@ namespace boost mpl::bool_<(function_traits::arity == 1)> {}; + template + struct is_unary_function; + +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200) template struct is_unary_function : mpl::apply_if< is_function @@ -132,15 +136,21 @@ namespace boost , mpl::bool_ >::type {}; +#endif } // - // ToDo: Think twice wether enable_if is better than an + // ToDo: Think twice whether enable_if is better than an // static assert. Currently we get convoluted error messages // from the above overload for any pointer that is not a // pointer to a unary function. // + // If function does not accept function type syntax we are out + // of luck. Ok we can spell it out for typename detail::enable_if< detail::is_unary_function @@ -150,6 +160,7 @@ namespace boost { return make_transform_iterator(it, function(fun)); } +#endif } // namespace boost diff --git a/test/transform_iterator_test.cpp b/test/transform_iterator_test.cpp index 8d6a55e..4161cc4 100644 --- a/test/transform_iterator_test.cpp +++ b/test/transform_iterator_test.cpp @@ -132,6 +132,7 @@ main() boost::random_access_readable_iterator_test(i, N, x); } +#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) // Test transform_iterator with function pointers { int x[N], y[N]; @@ -155,6 +156,7 @@ main() , x); } +#endif // Test transform_iterator as projection iterator {