From 52c0d22cffca8f9a261e3640c968fdcb54cd9a97 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 14 Jul 2003 23:05:57 +0000 Subject: [PATCH] Bugfixes and workarounds [SVN r19121] --- include/boost/iterator/filter_iterator.hpp | 4 ++++ include/boost/iterator/transform_iterator.hpp | 6 +++++- test/transform_iterator_test.cpp | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/boost/iterator/filter_iterator.hpp b/include/boost/iterator/filter_iterator.hpp index 059afc5..390dc8e 100644 --- a/include/boost/iterator/filter_iterator.hpp +++ b/include/boost/iterator/filter_iterator.hpp @@ -59,9 +59,13 @@ namespace boost filter_iterator(Iterator x, Iterator end = Iterator()) : super_t(x), m_predicate(), m_end(end) { + // Pro8 is a little too aggressive about instantiating the + // body of this function. +#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // Don't allow use of this constructor if Predicate is a // function pointer type, since it will be 0. BOOST_STATIC_ASSERT(is_class::value); +#endif satisfy_predicate(); } diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp index 47ea9ac..f281b82 100644 --- a/include/boost/iterator/transform_iterator.hpp +++ b/include/boost/iterator/transform_iterator.hpp @@ -115,12 +115,16 @@ namespace boost transform_iterator(Iterator const& x, UnaryFunction f) : super_t(x), m_f(f) { } - transform_iterator(Iterator const& x) + explicit transform_iterator(Iterator const& x) : super_t(x) { + // Pro8 is a little too aggressive about instantiating the + // body of this function. +#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // don't provide this constructor if UnaryFunction is a // function pointer type, since it will be 0. Too dangerous. BOOST_STATIC_ASSERT(is_class::value); +#endif } template diff --git a/test/transform_iterator_test.cpp b/test/transform_iterator_test.cpp index fe694b5..8eb5121 100644 --- a/test/transform_iterator_test.cpp +++ b/test/transform_iterator_test.cpp @@ -39,6 +39,10 @@ namespace boost { namespace detail template<> struct iterator_traits const*> : ptr_iter_traits, std::pair const> {}; + template<> struct function_object_result + { + typedef int type; + }; }} #endif