diff --git a/include/boost/iterator/detail/facade_iterator_category.hpp b/include/boost/iterator/detail/facade_iterator_category.hpp index 6728700..2c4771d 100755 --- a/include/boost/iterator/detail/facade_iterator_category.hpp +++ b/include/boost/iterator/detail/facade_iterator_category.hpp @@ -6,13 +6,12 @@ # include -# include - # include // used in iterator_tag inheritance logic # include # include # include # include +# include # include # include @@ -139,29 +138,21 @@ template struct iterator_category_with_traversal : Category, Traversal { -# if 0 - // Because of limitations on multiple user-defined conversions, - // this should be a good test of whether convertibility is enough - // in the spec, or whether we need to specify inheritance. - operator Category() const { return Category(); } - operator Traversal() const { return Traversal(); } -# endif - # if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) // Make sure this isn't used to build any categories where // convertibility to Traversal is redundant. Should just use the // Category element in that case. - BOOST_STATIC_ASSERT( - !(is_convertible< + BOOST_MPL_ASSERT_NOT(( + is_convertible< typename iterator_category_to_traversal::type , Traversal - >::value)); + >)); - BOOST_STATIC_ASSERT(is_iterator_category::value); - BOOST_STATIC_ASSERT(!is_iterator_category::value); - BOOST_STATIC_ASSERT(!is_iterator_traversal::value); + BOOST_MPL_ASSERT((is_iterator_category)); + BOOST_MPL_ASSERT_NOT((is_iterator_category)); + BOOST_MPL_ASSERT_NOT((is_iterator_traversal)); # if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) - BOOST_STATIC_ASSERT(is_iterator_traversal::value); + BOOST_MPL_ASSERT((is_iterator_traversal)); # endif # endif }; @@ -172,7 +163,7 @@ template struct facade_iterator_category_impl { # if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - BOOST_STATIC_ASSERT(!is_iterator_category::value); + BOOST_MPL_ASSERT_NOT((is_iterator_category)); # endif typedef typename iterator_facade_default_category< diff --git a/include/boost/iterator/iterator_adaptor.hpp b/include/boost/iterator/iterator_adaptor.hpp index 457c439..ef667c7 100644 --- a/include/boost/iterator/iterator_adaptor.hpp +++ b/include/boost/iterator/iterator_adaptor.hpp @@ -110,7 +110,7 @@ namespace boost is_same , is_convertible > - , detail::enable_type + , boost::detail::enable_type , int& >::type type; }; @@ -120,7 +120,7 @@ namespace boost template struct enable_if_convertible { - typedef detail::enable_type type; + typedef boost::detail::enable_type type; }; # elif BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) && BOOST_MSVC > 1300 @@ -134,7 +134,7 @@ namespace boost is_same , is_convertible > - , detail::enable_type + , boost::detail::enable_type > {}; @@ -144,7 +144,7 @@ namespace boost struct enable_if_convertible : iterators::enable_if< is_convertible - , detail::enable_type + , boost::detail::enable_type > {}; @@ -183,7 +183,7 @@ namespace boost Derived # ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Value , mpl::eval_if< is_same @@ -192,17 +192,17 @@ namespace boost > >::type # else - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Value, iterator_value >::type # endif - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Traversal , iterator_traversal >::type - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Reference , mpl::eval_if< is_same @@ -211,7 +211,7 @@ namespace boost > >::type - , typename detail::ia_dflt_help< + , typename boost::detail::ia_dflt_help< Difference, iterator_difference >::type > @@ -260,14 +260,14 @@ namespace boost , class Difference = use_default > class iterator_adaptor - : public detail::iterator_adaptor_base< + : public boost::detail::iterator_adaptor_base< Derived, Base, Value, Traversal, Reference, Difference >::type { friend class iterator_core_access; protected: - typedef typename detail::iterator_adaptor_base< + typedef typename boost::detail::iterator_adaptor_base< Derived, Base, Value, Traversal, Reference, Difference >::type super_t; public: @@ -323,7 +323,7 @@ namespace boost >::type my_traversal; # define BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(cat) \ - detail::iterator_adaptor_assert_traversal(); + boost::detail::iterator_adaptor_assert_traversal(); void advance(typename super_t::difference_type n) { diff --git a/include/boost/iterator/iterator_archetypes.hpp b/include/boost/iterator/iterator_archetypes.hpp index 9ffa420..039de1c 100644 --- a/include/boost/iterator/iterator_archetypes.hpp +++ b/include/boost/iterator/iterator_archetypes.hpp @@ -196,6 +196,8 @@ namespace detail explicit archetype(ctor_arg arg) : traversal_archetype_(arg) {} + + typedef std::ptrdiff_t difference_type; }; }; @@ -219,7 +221,6 @@ namespace detail archetype() : traversal_archetype_(ctor_arg()) {} - typedef std::ptrdiff_t difference_type; }; }; diff --git a/include/boost/iterator/iterator_categories.hpp b/include/boost/iterator/iterator_categories.hpp index 564ae50..1740d98 100644 --- a/include/boost/iterator/iterator_categories.hpp +++ b/include/boost/iterator/iterator_categories.hpp @@ -150,7 +150,7 @@ struct iterator_category_to_traversal : mpl::eval_if< // if already convertible to a traversal tag, we're done. is_convertible , mpl::identity - , detail::old_category_to_traversal + , boost::detail::old_category_to_traversal > {}; diff --git a/include/boost/iterator/iterator_concepts.hpp b/include/boost/iterator/iterator_concepts.hpp index 4c27964..ced1112 100644 --- a/include/boost/iterator/iterator_concepts.hpp +++ b/include/boost/iterator/iterator_concepts.hpp @@ -6,12 +6,6 @@ #ifndef BOOST_ITERATOR_CONCEPTS_HPP #define BOOST_ITERATOR_CONCEPTS_HPP -// Revision History -// 26 Apr 2003 thw -// Adapted to new iterator concepts -// 22 Nov 2002 Thomas Witt -// Added interoperable concept. - #include #include @@ -20,7 +14,6 @@ #include #include -#include #include #include @@ -35,247 +28,226 @@ #include -namespace boost_concepts { +#include + +namespace boost_concepts +{ // Used a different namespace here (instead of "boost") so that the // concept descriptions do not take for granted the names in // namespace boost. - // We use this in place of STATIC_ASSERT((is_convertible<...>)) - // because some compilers (CWPro7.x) can't detect convertibility. - // - // Of course, that just gets us a different error at the moment with - // some tests, since new iterator category deduction still depends - // on convertibility detection. We might need some specializations - // to support this compiler. - template - struct static_assert_base_and_derived - { - static_assert_base_and_derived(Target* = (Source*)0) {} - }; - //=========================================================================== // Iterator Access Concepts - template - class ReadableIteratorConcept { - public: - typedef BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits::value_type value_type; + BOOST_concept(ReadableIterator,(Iterator)) + : boost::Assignable + , boost::CopyConstructible - void constraints() { - boost::function_requires< boost::AssignableConcept >(); - boost::function_requires< boost::CopyConstructibleConcept >(); + { + typedef BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits::value_type value_type; + typedef BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits::reference reference; - value_type v = *i; - boost::ignore_unused_variable_warning(v); - } - Iterator i; + BOOST_CONCEPT_USAGE(ReadableIterator) + { + + value_type v = *i; + boost::ignore_unused_variable_warning(v); + } + private: + Iterator i; }; template < typename Iterator , typename ValueType = BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits::value_type > - class WritableIteratorConcept { - public: - - void constraints() { - boost::function_requires< boost::CopyConstructibleConcept >(); - *i = v; - } - ValueType v; - Iterator i; - }; - - template - class SwappableIteratorConcept { - public: - - void constraints() { - std::iter_swap(i1, i2); - } - Iterator i1; - Iterator i2; - }; - - template - class LvalueIteratorConcept + struct WritableIterator + : boost::CopyConstructible + { + BOOST_CONCEPT_USAGE(WritableIterator) + { + *i = v; + } + private: + ValueType v; + Iterator i; + }; + + template < + typename Iterator + , typename ValueType = BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits::value_type + > + struct WritableIteratorConcept : WritableIterator {}; + + BOOST_concept(SwappableIterator,(Iterator)) + { + BOOST_CONCEPT_USAGE(SwappableIterator) + { + std::iter_swap(i1, i2); + } + private: + Iterator i1; + Iterator i2; + }; + + BOOST_concept(LvalueIterator,(Iterator)) { - public: typedef typename boost::detail::iterator_traits::value_type value_type; - void constraints() + + BOOST_CONCEPT_USAGE(LvalueIterator) { value_type& r = const_cast(*i); boost::ignore_unused_variable_warning(r); } - Iterator i; + private: + Iterator i; }; //=========================================================================== // Iterator Traversal Concepts - template - class IncrementableIteratorConcept { - public: - typedef typename boost::iterator_traversal::type traversal_category; + BOOST_concept(IncrementableIterator,(Iterator)) + : boost::Assignable + , boost::CopyConstructible + { + typedef typename boost::iterator_traversal::type traversal_category; - void constraints() { - boost::function_requires< boost::AssignableConcept >(); - boost::function_requires< boost::CopyConstructibleConcept >(); + BOOST_CONCEPT_ASSERT(( + boost::Convertible< + traversal_category + , boost::incrementable_traversal_tag + >)); - BOOST_STATIC_ASSERT( - (boost::is_convertible< - traversal_category - , boost::incrementable_traversal_tag - >::value - )); - - ++i; - (void)i++; - } - Iterator i; + BOOST_CONCEPT_USAGE(IncrementableIterator) + { + ++i; + (void)i++; + } + private: + Iterator i; }; - template - class SinglePassIteratorConcept { - public: - typedef typename boost::iterator_traversal::type traversal_category; - typedef typename boost::detail::iterator_traits::difference_type difference_type; + BOOST_concept(SinglePassIterator,(Iterator)) + : IncrementableIterator + , boost::EqualityComparable - void constraints() { - boost::function_requires< IncrementableIteratorConcept >(); - boost::function_requires< boost::EqualityComparableConcept >(); - - BOOST_STATIC_ASSERT( - (boost::is_convertible< - traversal_category - , boost::single_pass_traversal_tag - >::value - )); - } + { + BOOST_CONCEPT_ASSERT(( + boost::Convertible< + BOOST_DEDUCED_TYPENAME SinglePassIterator::traversal_category + , boost::single_pass_traversal_tag + > )); }; - template - class ForwardTraversalConcept { - public: - typedef typename boost::iterator_traversal::type traversal_category; - typedef typename boost::detail::iterator_traits::difference_type difference_type; + BOOST_concept(ForwardTraversal,(Iterator)) + : SinglePassIterator + , boost::DefaultConstructible + { + typedef typename boost::detail::iterator_traits::difference_type difference_type; + + BOOST_MPL_ASSERT((boost::is_integral)); + BOOST_MPL_ASSERT_RELATION(std::numeric_limits::is_signed, ==, true); - void constraints() { - boost::function_requires< SinglePassIteratorConcept >(); - boost::function_requires< - boost::DefaultConstructibleConcept >(); - - typedef boost::mpl::and_< - boost::is_integral, - boost::mpl::bool_< std::numeric_limits::is_signed > - > difference_type_is_signed_integral; - - BOOST_STATIC_ASSERT(difference_type_is_signed_integral::value); - BOOST_STATIC_ASSERT( - (boost::is_convertible< - traversal_category - , boost::forward_traversal_tag - >::value - )); - } + BOOST_CONCEPT_ASSERT(( + boost::Convertible< + BOOST_DEDUCED_TYPENAME ForwardTraversal::traversal_category + , boost::forward_traversal_tag + > )); }; - template - class BidirectionalTraversalConcept { - public: - typedef typename boost::iterator_traversal::type traversal_category; + BOOST_concept(BidirectionalTraversal,(Iterator)) + : ForwardTraversal + { + BOOST_CONCEPT_ASSERT(( + boost::Convertible< + BOOST_DEDUCED_TYPENAME BidirectionalTraversal::traversal_category + , boost::bidirectional_traversal_tag + > )); - void constraints() { - boost::function_requires< ForwardTraversalConcept >(); - - BOOST_STATIC_ASSERT( - (boost::is_convertible< - traversal_category - , boost::bidirectional_traversal_tag - >::value - )); - - --i; - (void)i--; - } - Iterator i; + BOOST_CONCEPT_USAGE(BidirectionalTraversal) + { + --i; + (void)i--; + } + private: + Iterator i; }; - template - class RandomAccessTraversalConcept { - public: - typedef typename boost::iterator_traversal::type traversal_category; - typedef typename boost::detail::iterator_traits::difference_type - difference_type; + BOOST_concept(RandomAccessTraversal,(Iterator)) + : BidirectionalTraversal + { + BOOST_CONCEPT_ASSERT(( + boost::Convertible< + BOOST_DEDUCED_TYPENAME RandomAccessTraversal::traversal_category + , boost::random_access_traversal_tag + > )); - void constraints() { - boost::function_requires< BidirectionalTraversalConcept >(); - - BOOST_STATIC_ASSERT( - (boost::is_convertible< - traversal_category - , boost::random_access_traversal_tag - >::value - )); + BOOST_CONCEPT_USAGE(RandomAccessTraversal) + { + i += n; + i = i + n; + i = n + i; + i -= n; + i = i - n; + n = i - j; + } - i += n; - i = i + n; - i = n + i; - i -= n; - i = i - n; - n = i - j; - } - difference_type n; - Iterator i, j; + private: + typename BidirectionalTraversal::difference_type n; + Iterator i, j; }; //=========================================================================== - // Iterator Interoperability Concept + // Iterator Interoperability namespace detail { - template void interop_single_pass_constraints(Iterator1 const& i1, Iterator2 const& i2) { - bool b; - b = i1 == i2; - b = i1 != i2; - - b = i2 == i1; - b = i2 != i1; + bool b; + b = i1 == i2; + b = i1 != i2; + + b = i2 == i1; + b = i2 != i1; + boost::ignore_unused_variable_warning(b); } - + template - void interop_rand_access_constraints(Iterator1 const& i1, Iterator2 const& i2, - boost::random_access_traversal_tag, boost::random_access_traversal_tag) + void interop_rand_access_constraints( + Iterator1 const& i1, Iterator2 const& i2, + boost::random_access_traversal_tag, boost::random_access_traversal_tag) { - bool b; - typename boost::detail::iterator_traits::difference_type n; - b = i1 < i2; - b = i1 <= i2; - b = i1 > i2; - b = i1 >= i2; - n = i1 - i2; - - b = i2 < i1; - b = i2 <= i1; - b = i2 > i1; - b = i2 >= i1; - n = i2 - i1; + bool b; + typename boost::detail::iterator_traits::difference_type n; + b = i1 < i2; + b = i1 <= i2; + b = i1 > i2; + b = i1 >= i2; + n = i1 - i2; + + b = i2 < i1; + b = i2 <= i1; + b = i2 > i1; + b = i2 >= i1; + n = i2 - i1; + boost::ignore_unused_variable_warning(b); + boost::ignore_unused_variable_warning(n); } + template - void interop_rand_access_constraints(Iterator1 const& i1, Iterator2 const& i2, - boost::single_pass_traversal_tag, boost::single_pass_traversal_tag) + void interop_rand_access_constraints( + Iterator1 const&, Iterator2 const&, + boost::single_pass_traversal_tag, boost::single_pass_traversal_tag) { } } // namespace detail - template - class InteroperableIteratorConcept + BOOST_concept(InteroperableIterator,(Iterator)(ConstIterator)) { - public: + private: typedef typename boost::detail::pure_traversal_tag< typename boost::iterator_traversal< Iterator @@ -287,22 +259,26 @@ namespace boost_concepts { ConstIterator >::type >::type const_traversal_category; + + public: + BOOST_CONCEPT_ASSERT((SinglePassIterator)); + BOOST_CONCEPT_ASSERT((SinglePassIterator)); - void constraints() + BOOST_CONCEPT_USAGE(InteroperableIterator) { - boost::function_requires< SinglePassIteratorConcept >(); - boost::function_requires< SinglePassIteratorConcept >(); - detail::interop_single_pass_constraints(i, ci); detail::interop_rand_access_constraints(i, ci, traversal_category(), const_traversal_category()); ci = i; } + + private: Iterator i; ConstIterator ci; }; } // namespace boost_concepts +#include #endif // BOOST_ITERATOR_CONCEPTS_HPP diff --git a/include/boost/iterator/iterator_facade.hpp b/include/boost/iterator/iterator_facade.hpp index 0e494fe..f9ea47c 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -106,7 +106,7 @@ namespace boost typedef typename remove_const::type value_type; typedef typename mpl::eval_if< - detail::iterator_writability_disabled + boost::detail::iterator_writability_disabled , add_pointer , add_pointer >::type pointer; @@ -446,7 +446,7 @@ namespace boost class Derived1, class V1, class TC1, class R1, class D1 \ , class Derived2, class V2, class TC2, class R2, class D2 \ > \ - prefix typename detail::enable_if_interoperable< \ + prefix typename boost::detail::enable_if_interoperable< \ Derived1, Derived2 \ , typename mpl::apply2::type \ >::type \ @@ -480,7 +480,7 @@ namespace boost template friend class iterator_facade; # define BOOST_ITERATOR_FACADE_RELATION(op) \ - BOOST_ITERATOR_FACADE_INTEROP_HEAD(friend,op, detail::always_bool2); + BOOST_ITERATOR_FACADE_INTEROP_HEAD(friend,op, boost::detail::always_bool2); BOOST_ITERATOR_FACADE_RELATION(==) BOOST_ITERATOR_FACADE_RELATION(!=) @@ -492,7 +492,7 @@ namespace boost # undef BOOST_ITERATOR_FACADE_RELATION BOOST_ITERATOR_FACADE_INTEROP_HEAD( - friend, -, detail::choose_difference_type) + friend, -, boost::detail::choose_difference_type) ; BOOST_ITERATOR_FACADE_PLUS_HEAD( @@ -594,7 +594,7 @@ namespace boost > class iterator_facade # ifdef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE - : public detail::iterator_facade_types< + : public boost::detail::iterator_facade_types< Value, CategoryOrTraversal, Reference, Difference >::base # undef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE @@ -614,7 +614,7 @@ namespace boost return *static_cast(this); } - typedef detail::iterator_facade_types< + typedef boost::detail::iterator_facade_types< Value, CategoryOrTraversal, Reference, Difference > associated_types; @@ -635,26 +635,26 @@ namespace boost return iterator_core_access::dereference(this->derived()); } - typename detail::operator_arrow_result< + typename boost::detail::operator_arrow_result< value_type , reference , pointer >::type operator->() const { - return detail::operator_arrow_result< + return boost::detail::operator_arrow_result< value_type , reference , pointer >::make(*this->derived()); } - typename detail::operator_brackets_result::type + typename boost::detail::operator_brackets_result::type operator[](difference_type n) const { - typedef detail::use_operator_brackets_proxy use_proxy; + typedef boost::detail::use_operator_brackets_proxy use_proxy; - return detail::make_operator_brackets_result( + return boost::detail::make_operator_brackets_result( this->derived() + n , use_proxy() ); @@ -667,10 +667,10 @@ namespace boost } # if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - typename detail::postfix_increment_result::type + typename boost::detail::postfix_increment_result::type operator++(int) { - typename detail::postfix_increment_result::type + typename boost::detail::postfix_increment_result::type tmp(this->derived()); ++*this; return tmp; @@ -723,13 +723,13 @@ namespace boost # if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) template - inline typename detail::postfix_increment_result::type + inline typename boost::detail::postfix_increment_result::type operator++( iterator_facade& i , int ) { - typename detail::postfix_increment_result::type + typename boost::detail::postfix_increment_result::type tmp(*static_cast(&i)); ++i; @@ -829,7 +829,7 @@ namespace boost # define BOOST_ITERATOR_FACADE_RELATION(op, return_prefix, base_op) \ BOOST_ITERATOR_FACADE_INTEROP( \ op \ - , detail::always_bool2 \ + , boost::detail::always_bool2 \ , return_prefix \ , base_op \ ) @@ -846,7 +846,7 @@ namespace boost // operator- requires an additional part in the static assertion BOOST_ITERATOR_FACADE_INTEROP( - - , detail::choose_difference_type + , boost::detail::choose_difference_type , return , distance_from ) diff --git a/include/boost/iterator/iterator_traits.hpp b/include/boost/iterator/iterator_traits.hpp index 1352710..960970e 100644 --- a/include/boost/iterator/iterator_traits.hpp +++ b/include/boost/iterator/iterator_traits.hpp @@ -27,32 +27,32 @@ namespace boost { template struct iterator_value { - typedef typename detail::iterator_traits::value_type type; + typedef typename boost::detail::iterator_traits::value_type type; }; template struct iterator_reference { - typedef typename detail::iterator_traits::reference type; + typedef typename boost::detail::iterator_traits::reference type; }; template struct iterator_pointer { - typedef typename detail::iterator_traits::pointer type; + typedef typename boost::detail::iterator_traits::pointer type; }; template struct iterator_difference { - typedef typename detail::iterator_traits::difference_type type; + typedef typename boost::detail::iterator_traits::difference_type type; }; template struct BOOST_ITERATOR_CATEGORY { - typedef typename detail::iterator_traits::iterator_category type; + typedef typename boost::detail::iterator_traits::iterator_category type; }; # if BOOST_WORKAROUND(BOOST_MSVC, < 1300) diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp index d637527..e449a8b 100644 --- a/include/boost/iterator/transform_iterator.hpp +++ b/include/boost/iterator/transform_iterator.hpp @@ -37,10 +37,10 @@ namespace boost namespace detail { - template + template struct function_object_result { - typedef typename UnaryFunction::result_type type; + typedef typename UnaryFunc::result_type type; }; #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION @@ -52,7 +52,7 @@ namespace boost #endif // Compute the iterator_adaptor instantiation to be used for transform_iterator - template + template struct transform_iterator_base { private: @@ -62,7 +62,7 @@ namespace boost // proposal (e.g. using Doug's result_of)? typedef typename ia_dflt_help< Reference - , function_object_result + , function_object_result >::type reference; // To get the default for Value: remove any reference on the @@ -77,7 +77,7 @@ namespace boost public: typedef iterator_adaptor< - transform_iterator + transform_iterator , Iterator , cv_value_type , use_default // Leave the traversal category alone @@ -86,12 +86,12 @@ namespace boost }; } - template + template class transform_iterator - : public detail::transform_iterator_base::type + : public boost::detail::transform_iterator_base::type { typedef typename - detail::transform_iterator_base::type + boost::detail::transform_iterator_base::type super_t; friend class iterator_core_access; @@ -99,7 +99,7 @@ namespace boost public: transform_iterator() { } - transform_iterator(Iterator const& x, UnaryFunction f) + transform_iterator(Iterator const& x, UnaryFunc f) : super_t(x), m_f(f) { } explicit transform_iterator(Iterator const& x) @@ -108,9 +108,9 @@ namespace boost // 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 + // don't provide this constructor if UnaryFunc is a // function pointer type, since it will be 0. Too dangerous. - BOOST_STATIC_ASSERT(is_class::value); + BOOST_STATIC_ASSERT(is_class::value); #endif } @@ -123,13 +123,13 @@ namespace boost transform_iterator const& t , typename enable_if_convertible::type* = 0 #if !BOOST_WORKAROUND(BOOST_MSVC, == 1310) - , typename enable_if_convertible::type* = 0 + , typename enable_if_convertible::type* = 0 #endif ) : super_t(t.base()), m_f(t.functor()) {} - UnaryFunction functor() const + UnaryFunc functor() const { return m_f; } private: @@ -138,38 +138,38 @@ namespace boost // Probably should be the initial base class so it can be // optimized away via EBO if it is an empty class. - UnaryFunction m_f; + UnaryFunc m_f; }; - template - transform_iterator - make_transform_iterator(Iterator it, UnaryFunction fun) + template + transform_iterator + make_transform_iterator(Iterator it, UnaryFunc fun) { - return transform_iterator(it, fun); + return transform_iterator(it, fun); } - // Version which allows explicit specification of the UnaryFunction + // Version which allows explicit specification of the UnaryFunc // type. // - // This generator is not provided if UnaryFunction is a function + // This generator is not provided if UnaryFunc is a function // pointer type, because it's too dangerous: the default-constructed // function pointer in the iterator be 0, leading to a runtime // crash. - template + template #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) typename mpl::if_< #else typename iterators::enable_if< #endif - is_class // We should probably find a cheaper test than is_class<> - , transform_iterator + is_class // We should probably find a cheaper test than is_class<> + , transform_iterator #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) , int[3] #endif >::type make_transform_iterator(Iterator it) { - return transform_iterator(it, UnaryFunction()); + return transform_iterator(it, UnaryFunc()); } #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) diff --git a/include/boost/iterator_adaptors.hpp b/include/boost/iterator_adaptors.hpp index 7058153..ed9579c 100644 --- a/include/boost/iterator_adaptors.hpp +++ b/include/boost/iterator_adaptors.hpp @@ -1,6 +1,9 @@ // Copyright David Abrahams 2004. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See www.boost.org/libs/iterator for documentation. + #ifndef ITERATOR_ADAPTORS_DWA2004725_HPP # define ITERATOR_ADAPTORS_DWA2004725_HPP