From 041408a39cb2c702d665b233ca11da94e8d844d3 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Sat, 11 Jan 2003 21:35:52 +0000 Subject: [PATCH] workaround for gcc 2.95.2 [SVN r845] --- .../boost/iterator/iterator_categories.hpp | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/include/boost/iterator/iterator_categories.hpp b/include/boost/iterator/iterator_categories.hpp index f417b58..7fa91ec 100644 --- a/include/boost/iterator/iterator_categories.hpp +++ b/include/boost/iterator/iterator_categories.hpp @@ -107,9 +107,12 @@ namespace boost { { }; -#if BOOST_WORKAROUND(__MWERKS__, <=0x2407) + template + struct is_boost_iterator_tag; + +#if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) // - // has_traversal fails for cwpro7, so we have to use + // has_xxx fails, so we have to use // something less sophisticated. // // The solution depends on the fact that only @@ -123,7 +126,16 @@ namespace boost { mpl::logical_not< is_output_iterator > > {}; +#elif BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) + + template + struct is_new_iterator_tag + : is_boost_iterator_tag + { + }; + #else + BOOST_MPL_HAS_XXX_TRAIT_DEF(traversal) template @@ -256,6 +268,34 @@ namespace boost { typedef TraversalTag traversal; }; + namespace detail + { +# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + template + struct is_boost_iterator_tag + : mpl::false_c {}; + + template + struct is_boost_iterator_tag > + : mpl::true_c {}; +# else + template + struct is_boost_iterator_tag_impl + { + template + static char (& test(iterator_tag const&) )[1]; + static char (& test(...) )[2]; + static T inst; + BOOST_STATIC_CONSTANT(bool, value = sizeof(test(inst)) == 1); + }; + + template + struct is_boost_iterator_tag + : mpl::bool_c::value> + {}; +# endif + } + } // namespace boost #ifdef BOOST_NO_IS_CONVERTIBLE