From 512298cb5cf4b7ca5e8000f41bb39bda7f7bb6eb Mon Sep 17 00:00:00 2001 From: "Jeffrey Lee Hellrung, Jr." Date: Mon, 8 Oct 2012 02:02:09 +0000 Subject: [PATCH 01/15] - BREAKING CHANGE: iterator_facade::pointer now corresponds to the actual result of iterator_facade::operator-> rather than Value*. This required an adjustment to a test. - The logic for determining the result of iterator_facade::operator[] has been factored out into a separate detail header in preparation for its potential use in iterator_range to avoid iterator_range::operator[] from returning a reference to a temporary. [SVN r80901] --- .../detail/operator_brackets_dispatch.hpp | 88 ++++++++++ include/boost/iterator/iterator_facade.hpp | 151 +++++------------- test/indirect_iter_member_types.cpp | 2 +- 3 files changed, 130 insertions(+), 111 deletions(-) create mode 100644 include/boost/iterator/detail/operator_brackets_dispatch.hpp diff --git a/include/boost/iterator/detail/operator_brackets_dispatch.hpp b/include/boost/iterator/detail/operator_brackets_dispatch.hpp new file mode 100644 index 0000000..fdbd929 --- /dev/null +++ b/include/boost/iterator/detail/operator_brackets_dispatch.hpp @@ -0,0 +1,88 @@ +// (C) Copyright David Abrahams 2002. +// (C) Copyright Jeremy Siek 2002. +// (C) Copyright Thomas Witt 2002. +// (C) Copyright Jeffrey Lee Hellrung, Jr. 2012. +// 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) +#ifndef BOOST_OPERATOR_BRACKETS_DISPATCH_07102012JLH_HPP +#define BOOST_OPERATOR_BRACKETS_DISPATCH_07102012JLH_HPP + +#include + +#include +#include + +#include + +namespace boost { namespace detail { + +// operator[] must return a proxy in case iterator destruction invalidates +// referents. +// To see why, consider the following implementation of operator[]: +// reference operator[](difference_type n) const +// { return *(*this + n); } +// The problem here is that operator[] would return a reference created from +// a temporary iterator. + +template +struct operator_brackets_value +{ + typedef Value result_type; + template + static result_type apply(Iterator const & i) + { return *i; } +}; + +template +struct operator_brackets_const_proxy +{ + class result_type + { + Iterator const m_i; + explicit result_type(Iterator const & i) : m_i(i) { } + friend struct operator_brackets_const_proxy; + void operator=(result_type&); + public: + operator Reference() const { return *m_i; } + }; + static result_type apply(Iterator const & i) + { return result_type(i); } +}; + +template +struct operator_brackets_proxy +{ + class result_type + { + Iterator const m_i; + explicit result_type(Iterator const & i) : m_i(i) { } + friend struct operator_brackets_proxy; + void operator=(result_type&); + public: + operator Reference() const { return *m_i; } + operator_brackets_proxy const & operator=( + typename Iterator::value_type const & x) const + { *m_i = x; return *this; } + }; + static result_type apply(Iterator const & i) + { return result_type(i); } +}; + +template +struct operator_brackets_dispatch +{ + typedef typename mpl::if_c< + iterator_writability_disabled::value, + typename mpl::if_c< + boost::is_POD::value, + operator_brackets_value::type>, + operator_brackets_const_proxy + >::type, + operator_brackets_proxy + >::type type; +}; + +} } // namespace detail / namespace boost + +#endif // #ifndef BOOST_OPERATOR_BRACKETS_DISPATCH_07102012JLH_HPP diff --git a/include/boost/iterator/iterator_facade.hpp b/include/boost/iterator/iterator_facade.hpp index d84b402..6f55692 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -1,6 +1,7 @@ // (C) Copyright David Abrahams 2002. // (C) Copyright Jeremy Siek 2002. // (C) Copyright Thomas Witt 2002. +// (C) copyright Jeffrey Lee Hellrung, Jr. 2012. // 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) @@ -13,6 +14,7 @@ #include #include +#include #include #include @@ -75,7 +77,7 @@ namespace boost , Return , int[3] >::type type; - }; + }; #else : ::boost::iterators::enable_if< mpl::or_< @@ -85,7 +87,7 @@ namespace boost , Return > {}; -#endif +#endif // // Generates associated types for an iterator_facade with the @@ -94,7 +96,7 @@ namespace boost template < class ValueParam , class CategoryOrTraversal - , class Reference + , class Reference , class Difference > struct iterator_facade_types @@ -102,16 +104,16 @@ namespace boost typedef typename facade_iterator_category< CategoryOrTraversal, ValueParam, Reference >::type iterator_category; - + typedef typename remove_const::type value_type; - + // Not the real associated pointer type typedef typename mpl::eval_if< boost::detail::iterator_writability_disabled , add_pointer , add_pointer >::type pointer; - + # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ && (BOOST_WORKAROUND(_STLPORT_VERSION, BOOST_TESTED_AT(0x452)) \ || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, BOOST_TESTED_AT(310))) \ @@ -157,7 +159,7 @@ namespace boost private: mutable value_type stored_value; }; - + // // In general, we can't determine that such an iterator isn't // writable -- we also need to store a copy of the old iterator so @@ -209,7 +211,7 @@ namespace boost { return stored_iterator; } - + private: mutable value_type stored_value; Iterator stored_iterator; @@ -221,7 +223,7 @@ namespace boost struct is_non_proxy_reference_impl { static Reference r; - + template static typename mpl::if_< is_convertible< @@ -231,17 +233,17 @@ namespace boost , char[1] , char[2] >::type& helper(R const&); - + BOOST_STATIC_CONSTANT(bool, value = sizeof(helper(r)) == 1); }; - + template struct is_non_proxy_reference : mpl::bool_< is_non_proxy_reference_impl::value > {}; -# else +# else template struct is_non_proxy_reference : is_convertible< @@ -250,8 +252,8 @@ namespace boost , Value const volatile* > {}; -# endif - +# endif + // A metafunction to choose the result type of postfix ++ // // Because the C++98 input iterator requirements say that *r++ has @@ -273,7 +275,7 @@ namespace boost mpl::and_< // A proxy is only needed for readable iterators is_convertible - + // No multipass iterator can have values that disappear // before positions can be re-visited , mpl::not_< @@ -296,7 +298,7 @@ namespace boost // standard's requirements. If *i is not a reference type, we must still // produce an lvalue to which a pointer can be formed. We do that by // returning a proxy object containing an instance of the reference object. - template + template struct operator_arrow_dispatch // proxy references { struct proxy @@ -315,10 +317,10 @@ namespace boost } }; - template - struct operator_arrow_dispatch // "real" references + template + struct operator_arrow_dispatch // "real" references { - typedef Pointer result_type; + typedef T* result_type; static result_type apply(T& x) { return boost::addressof(x); @@ -328,79 +330,12 @@ namespace boost # if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // Deal with ETI template<> - struct operator_arrow_dispatch + struct operator_arrow_dispatch { typedef int result_type; }; # endif - // A proxy return type for operator[], needed to deal with - // iterators that may invalidate referents upon destruction. - // Consider the temporary iterator in *(a + n) - template - class operator_brackets_proxy - { - // Iterator is actually an iterator_facade, so we do not have to - // go through iterator_traits to access the traits. - typedef typename Iterator::reference reference; - typedef typename Iterator::value_type value_type; - - public: - operator_brackets_proxy(Iterator const& iter) - : m_iter(iter) - {} - - operator reference() const - { - return *m_iter; - } - - operator_brackets_proxy& operator=(value_type const& val) - { - *m_iter = val; - return *this; - } - - private: - Iterator m_iter; - }; - - // A metafunction that determines whether operator[] must return a - // proxy, or whether it can simply return a copy of the value_type. - template - struct use_operator_brackets_proxy - : mpl::not_< - mpl::and_< - // Really we want an is_copy_constructible trait here, - // but is_POD will have to suffice in the meantime. - boost::is_POD - , iterator_writability_disabled - > - > - {}; - - template - struct operator_brackets_result - { - typedef typename mpl::if_< - use_operator_brackets_proxy - , operator_brackets_proxy - , Value - >::type type; - }; - - template - operator_brackets_proxy make_operator_brackets_result(Iterator const& iter, mpl::true_) - { - return operator_brackets_proxy(iter); - } - - template - typename Iterator::value_type make_operator_brackets_result(Iterator const& iter, mpl::false_) - { - return *iter; - } - struct choose_difference_type { template @@ -414,13 +349,13 @@ namespace boost , typename I1::difference_type , typename I2::difference_type > -# else +# else mpl::eval_if< is_convertible , iterator_difference , iterator_difference > -# endif +# endif {}; }; @@ -438,7 +373,7 @@ namespace boost operator op( \ iterator_facade const& lhs \ , iterator_facade const& rhs) -# else +# else # define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \ template < \ class Derived1, class V1, class TC1, class Reference1, class Difference1 \ @@ -451,7 +386,7 @@ namespace boost operator op( \ iterator_facade const& lhs \ , iterator_facade const& rhs) -# endif +# endif # define BOOST_ITERATOR_FACADE_PLUS_HEAD(prefix,args) \ template \ @@ -468,12 +403,12 @@ namespace boost // class iterator_core_access { -# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) +# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) // Tasteless as this may seem, making all members public allows member templates // to work in the absence of member template friends. public: # else - + template friend class iterator_facade; # define BOOST_ITERATOR_FACADE_RELATION(op) \ @@ -616,14 +551,15 @@ namespace boost > associated_types; typedef boost::detail::operator_arrow_dispatch< - Reference - , typename associated_types::pointer - > operator_arrow_dispatch_; + Reference> operator_arrow_dispatch_; + + typedef typename boost::detail::operator_brackets_dispatch< + Derived, Value, Reference>::type operator_brackets_dispatch_; protected: // For use by derived classes typedef iterator_facade iterator_facade_; - + public: typedef typename associated_types::value_type value_type; @@ -643,16 +579,11 @@ namespace boost { return operator_arrow_dispatch_::apply(*this->derived()); } - - typename boost::detail::operator_brackets_result::type + + typename operator_brackets_dispatch_::result_type operator[](difference_type n) const { - typedef boost::detail::use_operator_brackets_proxy use_proxy; - - return boost::detail::make_operator_brackets_result( - this->derived() + n - , use_proxy() - ); + return operator_brackets_dispatch_::apply(this->derived() + n); } Derived& operator++() @@ -671,7 +602,7 @@ namespace boost return tmp; } # endif - + Derived& operator--() { iterator_core_access::decrement(this->derived()); @@ -726,14 +657,14 @@ namespace boost { typename boost::detail::postfix_increment_result::type tmp(*static_cast(&i)); - + ++i; - + return tmp; } -# endif +# endif + - // // Comparison operator implementation. The library supplied operators // enables the user to provide fully interoperable constant/mutable diff --git a/test/indirect_iter_member_types.cpp b/test/indirect_iter_member_types.cpp index 84dcaeb..c2a52fb 100644 --- a/test/indirect_iter_member_types.cpp +++ b/test/indirect_iter_member_types.cpp @@ -82,7 +82,7 @@ int main() typedef boost::indirect_iterator Iter; STATIC_ASSERT_SAME(Iter::value_type, int); STATIC_ASSERT_SAME(Iter::reference, long&); - STATIC_ASSERT_SAME(Iter::pointer, int*); + STATIC_ASSERT_SAME(Iter::pointer, long*); STATIC_ASSERT_SAME(Iter::difference_type, short); } return 0; From 8345293f94592472c8af158c459943f049e559e1 Mon Sep 17 00:00:00 2001 From: "Jeffrey Lee Hellrung, Jr." Date: Mon, 8 Oct 2012 02:17:55 +0000 Subject: [PATCH 02/15] refs #6404 [SVN r80902] --- doc/iterator_facade_ref.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/iterator_facade_ref.rst b/doc/iterator_facade_ref.rst index c1baf9b..87c032a 100644 --- a/doc/iterator_facade_ref.rst +++ b/doc/iterator_facade_ref.rst @@ -106,7 +106,7 @@ The ``iterator_category`` member of ``iterator_facade`` is .. parsed-literal:: - *iterator-category*\ (CategoryOrTraversal, value_type, reference) + *iterator-category*\ (CategoryOrTraversal, reference, value_type) where *iterator-category* is defined as follows: From db29a874f10a9ab019edb7ad61ecf3719054ec6e Mon Sep 17 00:00:00 2001 From: "Jeffrey Lee Hellrung, Jr." Date: Mon, 8 Oct 2012 03:22:45 +0000 Subject: [PATCH 03/15] refs #6403 [SVN r80903] --- .../iterator/detail/facade_iterator_category.hpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) mode change 100755 => 100644 include/boost/iterator/detail/facade_iterator_category.hpp diff --git a/include/boost/iterator/detail/facade_iterator_category.hpp b/include/boost/iterator/detail/facade_iterator_category.hpp old mode 100755 new mode 100644 index 2c4771d..1f8e525 --- a/include/boost/iterator/detail/facade_iterator_category.hpp +++ b/include/boost/iterator/detail/facade_iterator_category.hpp @@ -73,15 +73,8 @@ struct iterator_writability_disabled // Convert an iterator_facade's traversal category, Value parameter, // and ::reference type to an appropriate old-style category. // -// If writability has been disabled per the above metafunction, the -// result will not be convertible to output_iterator_tag. -// -// Otherwise, if Traversal == single_pass_traversal_tag, the following -// conditions will result in a tag that is convertible both to -// input_iterator_tag and output_iterator_tag: -// -// 1. Reference is a reference to non-const -// 2. Reference is not a reference and is convertible to Value +// Due to changeset 21683, this now never results in a category convertible +// to output_iterator_tag. // template struct iterator_facade_default_category From 30a13b814192b7761a11b8738a1941c00d07d47e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 26 Sep 2013 09:43:37 +0000 Subject: [PATCH 04/15] Iterator: Remove use of eti baseclass workaround. [SVN r85940] --- .../boost/iterator/iterator_archetypes.hpp | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/include/boost/iterator/iterator_archetypes.hpp b/include/boost/iterator/iterator_archetypes.hpp index 039de1c..323949a 100644 --- a/include/boost/iterator/iterator_archetypes.hpp +++ b/include/boost/iterator/iterator_archetypes.hpp @@ -20,7 +20,6 @@ #include -#include #include #include #include @@ -119,26 +118,24 @@ namespace detail template struct operator_brackets - : mpl::aux::msvc_eti_base< - typename mpl::eval_if< - is_convertible - , mpl::eval_if< + : mpl::eval_if< + is_convertible + , mpl::eval_if< + iterator_archetypes::has_access< + AccessCategory + , iterator_archetypes::writable_iterator_t + > + , mpl::identity > + , mpl::if_< iterator_archetypes::has_access< AccessCategory - , iterator_archetypes::writable_iterator_t - > - , mpl::identity > - , mpl::if_< - iterator_archetypes::has_access< - AccessCategory - , iterator_archetypes::readable_iterator_t - > - , readable_operator_brackets - , no_operator_brackets + , iterator_archetypes::readable_iterator_t > + , readable_operator_brackets + , no_operator_brackets > - , mpl::identity - >::type + > + , mpl::identity >::type {}; @@ -154,9 +151,7 @@ namespace detail template struct traversal_archetype_ - : mpl::aux::msvc_eti_base< - typename traversal_archetype_impl::template archetype - >::type + : traversal_archetype_impl::template archetype { typedef typename traversal_archetype_impl::template archetype @@ -309,11 +304,9 @@ struct iterator_access_archetype_impl template struct iterator_access_archetype - : mpl::aux::msvc_eti_base< - typename iterator_access_archetype_impl< - AccessCategory - >::template archetype - >::type + : iterator_access_archetype_impl< + AccessCategory + >::template archetype { }; From a6a8fd00d7a049c69bb0585615a9ded6740c7751 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 15:54:03 +0000 Subject: [PATCH 05/15] Iterator: Remove obsolete GCC version check. [SVN r86055] --- include/boost/iterator/detail/config_def.hpp | 8 +++----- include/boost/iterator/iterator_traits.hpp | 13 +------------ 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/include/boost/iterator/detail/config_def.hpp b/include/boost/iterator/detail/config_def.hpp index fa8d667..f830631 100644 --- a/include/boost/iterator/detail/config_def.hpp +++ b/include/boost/iterator/detail/config_def.hpp @@ -88,8 +88,7 @@ # define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work for simple types" #endif -#if BOOST_WORKAROUND(__GNUC__, == 2) \ - || BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4) && !defined(__EDG_VERSION__) \ +#if BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4) && !defined(__EDG_VERSION__) \ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) # define BOOST_NO_IS_CONVERTIBLE_TEMPLATE // The following program fails to compile: @@ -122,10 +121,9 @@ # define BOOST_ARG_DEPENDENT_TYPENAME # endif -# if BOOST_WORKAROUND(__GNUC__, == 2) && BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(95)) \ - || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) -// GCC-2.95 eagerly instantiates templated constructors and conversion +// GCC-2.95 (obsolete) eagerly instantiates templated constructors and conversion // operators in convertibility checks, causing premature errors. // // Borland's problems are harder to diagnose due to lack of an diff --git a/include/boost/iterator/iterator_traits.hpp b/include/boost/iterator/iterator_traits.hpp index 960970e..8846d3b 100644 --- a/include/boost/iterator/iterator_traits.hpp +++ b/include/boost/iterator/iterator_traits.hpp @@ -10,18 +10,7 @@ namespace boost { -// Unfortunately, g++ 2.95.x chokes when we define a class template -// iterator_category which has the same name as its -// std::iterator_category() function, probably due in part to the -// "std:: is visible globally" hack it uses. Use -// BOOST_ITERATOR_CATEGORY to write code that's portable to older -// GCCs. - -# if BOOST_WORKAROUND(__GNUC__, <= 2) -# define BOOST_ITERATOR_CATEGORY iterator_category_ -# else -# define BOOST_ITERATOR_CATEGORY iterator_category -# endif +#define BOOST_ITERATOR_CATEGORY iterator_category template From 1b2fbfaaca77a8d8a38e449b9c4859dae8279211 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 15:54:32 +0000 Subject: [PATCH 06/15] Remove use of BOOST_ITERATOR_CATEGORY [SVN r86056] --- include/boost/iterator/iterator_traits.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/iterator/iterator_traits.hpp b/include/boost/iterator/iterator_traits.hpp index 8846d3b..49c91f3 100644 --- a/include/boost/iterator/iterator_traits.hpp +++ b/include/boost/iterator/iterator_traits.hpp @@ -10,6 +10,7 @@ namespace boost { +// Obsolete. Remove. #define BOOST_ITERATOR_CATEGORY iterator_category @@ -39,7 +40,7 @@ struct iterator_difference }; template -struct BOOST_ITERATOR_CATEGORY +struct iterator_category { typedef typename boost::detail::iterator_traits::iterator_category type; }; @@ -70,7 +71,7 @@ struct iterator_difference }; template <> -struct BOOST_ITERATOR_CATEGORY +struct iterator_category { typedef void type; }; From 04bc178fc10a3e0911d765970bc81818b5eec6b1 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 16:04:19 +0000 Subject: [PATCH 07/15] Iterator: Remove obsolete MSVC version checks. [SVN r86082] --- include/boost/iterator/detail/config_def.hpp | 9 +--- .../boost/iterator/detail/config_undef.hpp | 1 - include/boost/iterator/detail/enable_if.hpp | 3 -- .../detail/facade_iterator_category.hpp | 4 -- .../iterator/detail/minimum_category.hpp | 26 +-------- include/boost/iterator/filter_iterator.hpp | 6 +-- include/boost/iterator/iterator_adaptor.hpp | 19 +------ .../boost/iterator/iterator_archetypes.hpp | 10 ---- .../boost/iterator/iterator_categories.hpp | 16 ------ include/boost/iterator/iterator_facade.hpp | 53 ------------------- include/boost/iterator/iterator_traits.hpp | 32 ----------- include/boost/iterator/transform_iterator.hpp | 7 --- include/boost/iterator/zip_iterator.hpp | 15 ------ 13 files changed, 5 insertions(+), 196 deletions(-) mode change 100755 => 100644 include/boost/iterator/detail/minimum_category.hpp diff --git a/include/boost/iterator/detail/config_def.hpp b/include/boost/iterator/detail/config_def.hpp index f830631..117e75a 100644 --- a/include/boost/iterator/detail/config_def.hpp +++ b/include/boost/iterator/detail/config_def.hpp @@ -46,8 +46,7 @@ #endif -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ - || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x5A0)) \ +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x5A0)) \ || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \ || BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) \ || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) @@ -115,12 +114,6 @@ # define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY #endif -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# define BOOST_ARG_DEPENDENT_TYPENAME typename -# else -# define BOOST_ARG_DEPENDENT_TYPENAME -# endif - # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) // GCC-2.95 (obsolete) eagerly instantiates templated constructors and conversion diff --git a/include/boost/iterator/detail/config_undef.hpp b/include/boost/iterator/detail/config_undef.hpp index 9dcd1d5..bf1b8d7 100644 --- a/include/boost/iterator/detail/config_undef.hpp +++ b/include/boost/iterator/detail/config_undef.hpp @@ -14,7 +14,6 @@ #undef BOOST_NO_IS_CONVERTIBLE #undef BOOST_NO_IS_CONVERTIBLE_TEMPLATE #undef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY -#undef BOOST_ARG_DEPENDENT_TYPENAME #undef BOOST_NO_LVALUE_RETURN_DETECTION #undef BOOST_NO_ONE_WAY_ITERATOR_INTEROP diff --git a/include/boost/iterator/detail/enable_if.hpp b/include/boost/iterator/detail/enable_if.hpp index 0fd36fc..dee66ba 100644 --- a/include/boost/iterator/detail/enable_if.hpp +++ b/include/boost/iterator/detail/enable_if.hpp @@ -72,9 +72,6 @@ namespace boost : mpl::identity # endif { -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - typedef Return type; -# endif }; } // namespace iterators diff --git a/include/boost/iterator/detail/facade_iterator_category.hpp b/include/boost/iterator/detail/facade_iterator_category.hpp index 1f8e525..31915e3 100644 --- a/include/boost/iterator/detail/facade_iterator_category.hpp +++ b/include/boost/iterator/detail/facade_iterator_category.hpp @@ -131,7 +131,6 @@ template struct iterator_category_with_traversal : Category, Traversal { -# 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. @@ -147,7 +146,6 @@ struct iterator_category_with_traversal # if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) BOOST_MPL_ASSERT((is_iterator_traversal)); # endif -# endif }; // Computes an iterator_category tag whose traversal is Traversal and @@ -155,9 +153,7 @@ struct iterator_category_with_traversal template struct facade_iterator_category_impl { -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) BOOST_MPL_ASSERT_NOT((is_iterator_category)); -# endif typedef typename iterator_facade_default_category< Traversal,ValueParam,Reference diff --git a/include/boost/iterator/detail/minimum_category.hpp b/include/boost/iterator/detail/minimum_category.hpp old mode 100755 new mode 100644 index 96501dd..1f4444f --- a/include/boost/iterator/detail/minimum_category.hpp +++ b/include/boost/iterator/detail/minimum_category.hpp @@ -21,17 +21,7 @@ namespace boost { namespace detail { // // template -struct minimum_category_impl -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -{ - template struct apply - { - typedef T2 type; - }; - typedef void type; -} -# endif -; +struct minimum_category_impl; template struct error_not_related_by_convertibility; @@ -77,14 +67,8 @@ template struct minimum_category { typedef minimum_category_impl< -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // ETI workaround - is_same::value || -# endif ::boost::is_convertible::value , ::boost::is_convertible::value -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // ETI workaround - || is_same::value -# endif > outer; typedef typename outer::template apply inner; @@ -102,14 +86,6 @@ struct minimum_category BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,minimum_category,(mpl::_1,mpl::_2)) }; - -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // ETI workaround -template <> -struct minimum_category -{ - typedef int type; -}; -# endif }} // namespace boost::detail diff --git a/include/boost/iterator/filter_iterator.hpp b/include/boost/iterator/filter_iterator.hpp index 14d640b..4282acc 100644 --- a/include/boost/iterator/filter_iterator.hpp +++ b/include/boost/iterator/filter_iterator.hpp @@ -121,11 +121,7 @@ namespace boost is_class , Iterator >::type x - , Iterator end = Iterator() -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - , Predicate* = 0 -#endif - ) + , Iterator end = Iterator()) { return filter_iterator(x,end); } diff --git a/include/boost/iterator/iterator_adaptor.hpp b/include/boost/iterator/iterator_adaptor.hpp index 9f2fbb0..ed8a82f 100644 --- a/include/boost/iterator/iterator_adaptor.hpp +++ b/include/boost/iterator/iterator_adaptor.hpp @@ -99,22 +99,7 @@ namespace boost // false positives for user/library defined iterator types. See comments // on operator implementation for consequences. // -# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - - template - struct enable_if_convertible - { - typedef typename mpl::if_< - mpl::or_< - is_same - , is_convertible - > - , boost::detail::enable_type - , int& - >::type type; - }; - -# elif defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE) +# if defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE) template struct enable_if_convertible @@ -122,7 +107,7 @@ namespace boost typedef boost::detail::enable_type type; }; -# elif BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) && BOOST_MSVC > 1300 +# elif BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) // For some reason vc7.1 needs us to "cut off" instantiation // of is_convertible in a few cases. diff --git a/include/boost/iterator/iterator_archetypes.hpp b/include/boost/iterator/iterator_archetypes.hpp index 323949a..ef60d9c 100644 --- a/include/boost/iterator/iterator_archetypes.hpp +++ b/include/boost/iterator/iterator_archetypes.hpp @@ -200,12 +200,6 @@ namespace detail bool operator==(traversal_archetype_ const&, traversal_archetype_ const&) { return true; } -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - // doesn't seem to pick up != from equality_comparable - template - bool operator!=(traversal_archetype_ const&, - traversal_archetype_ const&) { return true; } -#endif template <> struct traversal_archetype_impl { @@ -336,9 +330,7 @@ struct iterator_access_archetype_impl< template struct archetype { -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) BOOST_STATIC_ASSERT(!is_const::value); -# endif typedef void value_type; typedef void reference; typedef void pointer; @@ -389,9 +381,7 @@ struct iterator_access_archetype_impl { -# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) BOOST_STATIC_ASSERT((!is_const::value)); -# endif }; }; diff --git a/include/boost/iterator/iterator_categories.hpp b/include/boost/iterator/iterator_categories.hpp index 1740d98..24bf4e2 100644 --- a/include/boost/iterator/iterator_categories.hpp +++ b/include/boost/iterator/iterator_categories.hpp @@ -97,14 +97,6 @@ namespace detail > {}; -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - template <> - struct old_category_to_traversal - { - typedef int type; - }; -# endif - template struct pure_traversal_tag : mpl::eval_if< @@ -131,14 +123,6 @@ namespace detail { }; -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - template <> - struct pure_traversal_tag - { - typedef int type; - }; -# endif - } // namespace detail diff --git a/include/boost/iterator/iterator_facade.hpp b/include/boost/iterator/iterator_facade.hpp index 6f55692..1becb85 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -67,18 +67,6 @@ namespace boost , class Return > struct enable_if_interoperable -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - { - typedef typename mpl::if_< - mpl::or_< - is_convertible - , is_convertible - > - , Return - , int[3] - >::type type; - }; -#else : ::boost::iterators::enable_if< mpl::or_< is_convertible @@ -87,7 +75,6 @@ namespace boost , Return > {}; -#endif // // Generates associated types for an iterator_facade with the @@ -327,15 +314,6 @@ namespace boost } }; -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - // Deal with ETI - template<> - struct operator_arrow_dispatch - { - typedef int result_type; - }; -# endif - struct choose_difference_type { template @@ -343,12 +321,6 @@ namespace boost : # ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP iterator_difference -# elif BOOST_WORKAROUND(BOOST_MSVC, < 1300) - mpl::if_< - is_convertible - , typename I1::difference_type - , typename I2::difference_type - > # else mpl::eval_if< is_convertible @@ -592,17 +564,6 @@ namespace boost return this->derived(); } -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - typename boost::detail::postfix_increment_result::type - operator++(int) - { - typename boost::detail::postfix_increment_result::type - tmp(this->derived()); - ++*this; - return tmp; - } -# endif - Derived& operator--() { iterator_core_access::decrement(this->derived()); @@ -633,21 +594,8 @@ namespace boost Derived result(this->derived()); return result -= x; } - -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - // There appears to be a bug which trashes the data of classes - // derived from iterator_facade when they are assigned unless we - // define this assignment operator. This bug is only revealed - // (so far) in STLPort debug mode, but it's clearly a codegen - // problem so we apply the workaround for all MSVC6. - iterator_facade& operator=(iterator_facade const&) - { - return *this; - } -# endif }; -# if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) template inline typename boost::detail::postfix_increment_result::type operator++( @@ -662,7 +610,6 @@ namespace boost return tmp; } -# endif // diff --git a/include/boost/iterator/iterator_traits.hpp b/include/boost/iterator/iterator_traits.hpp index 49c91f3..856641c 100644 --- a/include/boost/iterator/iterator_traits.hpp +++ b/include/boost/iterator/iterator_traits.hpp @@ -45,38 +45,6 @@ struct iterator_category typedef typename boost::detail::iterator_traits::iterator_category type; }; -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -template <> -struct iterator_value -{ - typedef void type; -}; - -template <> -struct iterator_reference -{ - typedef void type; -}; - -template <> -struct iterator_pointer -{ - typedef void type; -}; - -template <> -struct iterator_difference -{ - typedef void type; -}; - -template <> -struct iterator_category -{ - typedef void type; -}; -# endif - } // namespace boost::iterator #endif // ITERATOR_TRAITS_DWA200347_HPP diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp index b79a440..168cb53 100644 --- a/include/boost/iterator/transform_iterator.hpp +++ b/include/boost/iterator/transform_iterator.hpp @@ -140,16 +140,9 @@ namespace boost // function pointer in the iterator be 0, leading to a runtime // crash. 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 -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - , int[3] -#endif >::type make_transform_iterator(Iterator it) { diff --git a/include/boost/iterator/zip_iterator.hpp b/include/boost/iterator/zip_iterator.hpp index a468070..cc30388 100644 --- a/include/boost/iterator/zip_iterator.hpp +++ b/include/boost/iterator/zip_iterator.hpp @@ -166,14 +166,7 @@ namespace boost { > struct tuple_meta_accumulate : mpl::eval_if< -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - mpl::or_< -#endif boost::is_same -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - , boost::is_same - > -#endif , mpl::identity , tuple_meta_accumulate_impl< Tuple @@ -366,14 +359,6 @@ namespace boost { , random_access_traversal_tag >::type type; }; - -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // ETI workaround - template <> - struct minimum_traversal_category_in_iterator_tuple - { - typedef int type; - }; -#endif // We need to call tuple_meta_accumulate with mpl::and_ as the // accumulating functor. To this end, we need to wrap it into From 9f661c9112d8b46a83b6915310bf9d7d6d87424d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Oct 2013 23:15:00 +0000 Subject: [PATCH 08/15] Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION Process #ifndef...#endif conditions. [SVN r86244] --- include/boost/iterator/iterator_adaptor.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/boost/iterator/iterator_adaptor.hpp b/include/boost/iterator/iterator_adaptor.hpp index ed8a82f..19f6774 100644 --- a/include/boost/iterator/iterator_adaptor.hpp +++ b/include/boost/iterator/iterator_adaptor.hpp @@ -38,14 +38,12 @@ namespace boost // explicitly in order to specify that the default should be used. struct use_default; -# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // the incompleteness of use_default causes massive problems for // is_convertible (naturally). This workaround is fortunately not // needed for vc6/vc7. template struct is_convertible : mpl::false_ {}; -# endif namespace detail { From f543f1e7b6ae8d1d1059a1540af7e108b7af0232 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Oct 2013 23:19:17 +0000 Subject: [PATCH 09/15] Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION Process #ifdef...#else...#endif blocks. [SVN r86246] --- include/boost/iterator/iterator_facade.hpp | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/include/boost/iterator/iterator_facade.hpp b/include/boost/iterator/iterator_facade.hpp index 1becb85..c936da5 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -204,33 +204,6 @@ namespace boost Iterator stored_iterator; }; -# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - template - struct is_non_proxy_reference_impl - { - static Reference r; - - template - static typename mpl::if_< - is_convertible< - R const volatile* - , Value const volatile* - > - , char[1] - , char[2] - >::type& helper(R const&); - - BOOST_STATIC_CONSTANT(bool, value = sizeof(helper(r)) == 1); - }; - - template - struct is_non_proxy_reference - : mpl::bool_< - is_non_proxy_reference_impl::value - > - {}; -# else template struct is_non_proxy_reference : is_convertible< @@ -239,7 +212,6 @@ namespace boost , Value const volatile* > {}; -# endif // A metafunction to choose the result type of postfix ++ // From bc34e54f6c0c2a277942a93f63f02d768e7b1f66 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Oct 2013 23:20:59 +0000 Subject: [PATCH 10/15] Simplify multi-component ifdefs containing BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION [SVN r86248] --- include/boost/iterator/detail/config_def.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/iterator/detail/config_def.hpp b/include/boost/iterator/detail/config_def.hpp index 117e75a..5101e84 100644 --- a/include/boost/iterator/detail/config_def.hpp +++ b/include/boost/iterator/detail/config_def.hpp @@ -26,7 +26,7 @@ // libs/iterator/test/constant_iterator_arrow.cpp fails to compile // because the operator-> return is improperly deduced as a non-const // pointer. -#if 1 || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ +#if 1 \ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531)) // Recall that in general, compilers without partial specialization From fecf28a440567f833720b3b83c1acd2c8b61c9e3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Oct 2013 23:22:36 +0000 Subject: [PATCH 11/15] Remove remaining occurances of BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION These evaded scripting. [SVN r86249] --- include/boost/iterator/iterator_facade.hpp | 5 +---- include/boost/iterator/transform_iterator.hpp | 10 ---------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/include/boost/iterator/iterator_facade.hpp b/include/boost/iterator/iterator_facade.hpp index c936da5..582f687 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -101,10 +101,7 @@ namespace boost , add_pointer >::type pointer; -# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ - && (BOOST_WORKAROUND(_STLPORT_VERSION, BOOST_TESTED_AT(0x452)) \ - || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, BOOST_TESTED_AT(310))) \ - || BOOST_WORKAROUND(BOOST_RWSTD_VER, BOOST_TESTED_AT(0x20101)) \ +# if BOOST_WORKAROUND(BOOST_RWSTD_VER, BOOST_TESTED_AT(0x20101)) \ || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, <= 310) // To interoperate with some broken library/compiler diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp index 168cb53..5d21369 100644 --- a/include/boost/iterator/transform_iterator.hpp +++ b/include/boost/iterator/transform_iterator.hpp @@ -148,16 +148,6 @@ namespace boost { return transform_iterator(it, UnaryFunc()); } - -#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - template - transform_iterator< Return (*)(Argument), Iterator, Return> - make_transform_iterator(Iterator it, Return (*fun)(Argument)) - { - return transform_iterator(it, fun); - } -#endif - } // namespace boost #include From 4a82a5646f408ebf72871b9e081f8dd22777d1fa Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Oct 2013 23:23:26 +0000 Subject: [PATCH 12/15] Remove use of obsolete BOOST_TT_BROKEN_COMPILER_SPEC [SVN r86250] --- include/boost/pending/iterator_tests.hpp | 3 --- test/indirect_iter_member_types.cpp | 2 -- test/indirect_iterator_test.cpp | 1 - test/is_lvalue_iterator.cpp | 3 --- test/is_readable_iterator.cpp | 2 -- test/pointee.cpp | 1 - test/unit_tests.cpp | 1 - 7 files changed, 13 deletions(-) mode change 100755 => 100644 test/is_lvalue_iterator.cpp mode change 100755 => 100644 test/is_readable_iterator.cpp mode change 100755 => 100644 test/pointee.cpp diff --git a/include/boost/pending/iterator_tests.hpp b/include/boost/pending/iterator_tests.hpp index dd5fe2d..f9d6e9c 100644 --- a/include/boost/pending/iterator_tests.hpp +++ b/include/boost/pending/iterator_tests.hpp @@ -25,7 +25,6 @@ # include # include // for detail::dummy_constructor # include -# include namespace boost { @@ -41,8 +40,6 @@ struct dummyT { } -BOOST_TT_BROKEN_COMPILER_SPEC(boost::dummyT) - namespace boost { // Tests whether type Iterator satisfies the requirements for a diff --git a/test/indirect_iter_member_types.cpp b/test/indirect_iter_member_types.cpp index c2a52fb..c61a46e 100644 --- a/test/indirect_iter_member_types.cpp +++ b/test/indirect_iter_member_types.cpp @@ -27,8 +27,6 @@ struct my_ptr { // typedef boost::no_traversal_tag iterator_category; }; -BOOST_TT_BROKEN_COMPILER_SPEC(my_ptr) -BOOST_TT_BROKEN_COMPILER_SPEC(zow) // Borland 5.6.4 and earlier drop const all over the place, so this // test will fail in the lines marked with (**) diff --git a/test/indirect_iterator_test.cpp b/test/indirect_iterator_test.cpp index 8cea482..22e710c 100644 --- a/test/indirect_iterator_test.cpp +++ b/test/indirect_iterator_test.cpp @@ -53,7 +53,6 @@ template struct see_val; struct my_iterator_tag : public std::random_access_iterator_tag { }; using boost::dummyT; -BOOST_TT_BROKEN_COMPILER_SPEC(boost::shared_ptr) typedef std::vector storage; typedef std::vector pointer_ra_container; diff --git a/test/is_lvalue_iterator.cpp b/test/is_lvalue_iterator.cpp old mode 100755 new mode 100644 index fdace52..ee57ab2 --- a/test/is_lvalue_iterator.cpp +++ b/test/is_lvalue_iterator.cpp @@ -20,7 +20,6 @@ struct v ~v(); }; -BOOST_TT_BROKEN_COMPILER_SPEC(v) struct value_iterator : boost::iterator { @@ -83,8 +82,6 @@ struct constant_lvalue_iterator constant_lvalue_iterator operator++(int); }; -BOOST_TT_BROKEN_COMPILER_SPEC(proxy_iterator::proxy) -BOOST_TT_BROKEN_COMPILER_SPEC(proxy_iterator::proxy) int main() { diff --git a/test/is_readable_iterator.cpp b/test/is_readable_iterator.cpp old mode 100755 new mode 100644 index 15ed099..c0c4b0a --- a/test/is_readable_iterator.cpp +++ b/test/is_readable_iterator.cpp @@ -20,7 +20,6 @@ struct v ~v(); }; -BOOST_TT_BROKEN_COMPILER_SPEC(v) struct value_iterator : boost::iterator { @@ -71,7 +70,6 @@ struct proxy_iterator2 : boost::iterator proxy operator*() const; }; -BOOST_TT_BROKEN_COMPILER_SPEC(proxy_iterator::proxy) int main() { diff --git a/test/pointee.cpp b/test/pointee.cpp old mode 100755 new mode 100644 index b39fce1..71d1d04 --- a/test/pointee.cpp +++ b/test/pointee.cpp @@ -35,7 +35,6 @@ struct X { template operator T&() const; }; -BOOST_TT_BROKEN_COMPILER_SPEC(X) int main() { diff --git a/test/unit_tests.cpp b/test/unit_tests.cpp index 2434310..15767c1 100644 --- a/test/unit_tests.cpp +++ b/test/unit_tests.cpp @@ -13,7 +13,6 @@ struct X { int a; }; -BOOST_TT_BROKEN_COMPILER_SPEC(X) struct Xiter : boost::iterator_adaptor { From d4d51389d11f26c5bcebaf45c7008fe895374219 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sat, 26 Oct 2013 10:13:38 +0000 Subject: [PATCH 13/15] Remove all references to now defunct (and removed) header. [SVN r86438] --- test/indirect_iterator_test.cpp | 2 -- test/is_lvalue_iterator.cpp | 1 - test/is_readable_iterator.cpp | 1 - test/iterator_adaptor_test.cpp | 2 -- test/unit_tests.cpp | 2 -- 5 files changed, 8 deletions(-) diff --git a/test/indirect_iterator_test.cpp b/test/indirect_iterator_test.cpp index 22e710c..c689673 100644 --- a/test/indirect_iterator_test.cpp +++ b/test/indirect_iterator_test.cpp @@ -27,8 +27,6 @@ #include -#include - #include #include diff --git a/test/is_lvalue_iterator.cpp b/test/is_lvalue_iterator.cpp index ee57ab2..a3f7b6f 100644 --- a/test/is_lvalue_iterator.cpp +++ b/test/is_lvalue_iterator.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include diff --git a/test/is_readable_iterator.cpp b/test/is_readable_iterator.cpp index c0c4b0a..ee58089 100644 --- a/test/is_readable_iterator.cpp +++ b/test/is_readable_iterator.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include diff --git a/test/iterator_adaptor_test.cpp b/test/iterator_adaptor_test.cpp index e339fe1..5b5e0c3 100644 --- a/test/iterator_adaptor_test.cpp +++ b/test/iterator_adaptor_test.cpp @@ -19,8 +19,6 @@ #endif #include -# include - # include #include diff --git a/test/unit_tests.cpp b/test/unit_tests.cpp index 15767c1..c53627d 100644 --- a/test/unit_tests.cpp +++ b/test/unit_tests.cpp @@ -7,8 +7,6 @@ #include "static_assert_same.hpp" -#include - #include struct X { int a; }; From dec42098dbd3eeb2ad3f74d4420ff9a3dcc623b6 Mon Sep 17 00:00:00 2001 From: Michel Morin Date: Wed, 30 Oct 2013 12:51:24 +0000 Subject: [PATCH 14/15] Correct broken links to C++ standard papers. Refs #9212. [SVN r86524] --- doc/facade-and-adaptor.html | 18 +++++++++--------- doc/facade-and-adaptor.rst | 8 ++++---- doc/issues.rst | 2 +- doc/iterator_facade.html | 4 ++-- doc/iterator_facade_body.rst | 4 ++-- doc/new-iter-concepts.html | 16 ++++++++-------- doc/new-iter-concepts.rst | 16 ++++++++-------- doc/quickbook/facade.qbk | 4 ++-- doc/ref_problem.rst | 2 +- 9 files changed, 37 insertions(+), 37 deletions(-) mode change 100755 => 100644 doc/facade-and-adaptor.html mode change 100755 => 100644 doc/issues.rst mode change 100755 => 100644 doc/new-iter-concepts.html diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html old mode 100755 new mode 100644 index 630ddcb..79d38a3 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -26,7 +26,7 @@ Lab, Zephyr Associates, Inc. Date: 2006-09-11 -Number:This is a revised version of N1530=03-0113, which was +Number:This is a revised version of N1530=03-0113, which was accepted for Technical Report 1 by the C++ standard committee's library working group. @@ -239,29 +239,29 @@ Iterator Concepts.

Iterator Concepts

This proposal is formulated in terms of the new iterator concepts -as proposed in n1550, since user-defined and especially adapted +as proposed in n1550, since user-defined and especially adapted iterators suffer from the well known categorization problems that are inherent to the current iterator categories.

-

This proposal does not strictly depend on proposal n1550, as there +

This proposal does not strictly depend on proposal n1550, as there is a direct mapping between new and old categories. This proposal -could be reformulated using this mapping if n1550 was not accepted.

+could be reformulated using this mapping if n1550 was not accepted.

Interoperability

The question of iterator interoperability is poorly addressed in the current standard. There are currently two defect reports that are concerned with interoperability issues.

-

Issue 179 concerns the fact that mutable container iterator types +

Issue 179 concerns the fact that mutable container iterator types are only required to be convertible to the corresponding constant iterator types, but objects of these types are not required to interoperate in comparison or subtraction expressions. This situation is tedious in practice and out of line with the way built in types work. This proposal implements the proposed resolution to issue -179, as most standard library implementations do nowadays. In other +179, as most standard library implementations do nowadays. In other words, if an iterator type A has an implicit or user defined conversion to an iterator type B, the iterator types are interoperable and the usual set of operators are available.

-

Issue 280 concerns the current lack of interoperability between +

Issue 280 concerns the current lack of interoperability between reverse iterator types. The proposed new reverse_iterator template fixes the issues raised in 280. It provides the desired interoperability without introducing unwanted overloads.

@@ -422,8 +422,8 @@ member (e.g. p+n, which is destroyed when operator[] returns.

Writable iterators built with iterator_facade implement the -semantics required by the preferred resolution to issue 299 and -adopted by proposal n1550: the result of p[n] is an object +semantics required by the preferred resolution to issue 299 and +adopted by proposal n1550: the result of p[n] is an object convertible to the iterator's value_type, and p[n] = x is equivalent to *(p + n) = x (Note: This result object may be implemented as a proxy containing a copy of p+n). This approach diff --git a/doc/facade-and-adaptor.rst b/doc/facade-and-adaptor.rst index 1be63e8..6308de4 100644 --- a/doc/facade-and-adaptor.rst +++ b/doc/facade-and-adaptor.rst @@ -19,7 +19,7 @@ .. Version 1.9 of this ReStructuredText document corresponds to n1530_, the paper accepted by the LWG. -.. _n1530: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1530.html +.. _n1530: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1530.html :copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. @@ -140,7 +140,7 @@ as proposed in n1550_, since user-defined and especially adapted iterators suffer from the well known categorization problems that are inherent to the current iterator categories. -.. _n1550: http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1550.html +.. _n1550: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2003/n1550.htm This proposal does not strictly depend on proposal n1550_, as there is a direct mapping between new and old categories. This proposal @@ -169,8 +169,8 @@ reverse iterator types. The proposed new reverse_iterator template fixes the issues raised in 280. It provides the desired interoperability without introducing unwanted overloads. -.. _179: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#179 -.. _280: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#280 +.. _179: http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#179 +.. _280: http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#280 Iterator Facade diff --git a/doc/issues.rst b/doc/issues.rst old mode 100755 new mode 100644 index 5ddb61f..a36f5a9 --- a/doc/issues.rst +++ b/doc/issues.rst @@ -3,7 +3,7 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. _N1550: http://www.boost-consulting.com/writing/n1550.html -.. _N1530: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1530.html +.. _N1530: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1530.html :Author: David Abrahams and Jeremy Siek :Contact: dave@boost-consulting.com, jsiek@osl.iu.edu diff --git a/doc/iterator_facade.html b/doc/iterator_facade.html index 57a69c0..21e048d 100644 --- a/doc/iterator_facade.html +++ b/doc/iterator_facade.html @@ -242,8 +242,8 @@ member (e.g. p+n, which is destroyed when operator[] returns.

Writable iterators built with iterator_facade implement the -semantics required by the preferred resolution to issue 299 and -adopted by proposal n1550: the result of p[n] is an object +semantics required by the preferred resolution to issue 299 and +adopted by proposal n1550: the result of p[n] is an object convertible to the iterator's value_type, and p[n] = x is equivalent to *(p + n) = x (Note: This result object may be implemented as a proxy containing a copy of p+n). This approach diff --git a/doc/iterator_facade_body.rst b/doc/iterator_facade_body.rst index 4b3059d..d0a13fe 100644 --- a/doc/iterator_facade_body.rst +++ b/doc/iterator_facade_body.rst @@ -167,9 +167,9 @@ the implementation of her iterator is free to implement an class; it will hide the one supplied by ``iterator_facade`` from clients of her iterator. -.. _n1550: http://anubis.dkuug.dk/JTC1/SC22/WG21/docs/papers/2003/n1550.html +.. _n1550: http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2003/n1550.htm -.. _`issue 299`: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#299 +.. _`issue 299`: http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#299 .. _`operator arrow`: diff --git a/doc/new-iter-concepts.html b/doc/new-iter-concepts.html old mode 100755 new mode 100644 index 51a4ee0..426bede --- a/doc/new-iter-concepts.html +++ b/doc/new-iter-concepts.html @@ -27,10 +27,10 @@ Lab, Zephyr Associates, Inc. Date: 2006-09-11 -Number:This is a revised version of n1550=03-0133, which was +Number:This is a revised version of n1550=03-0133, which was accepted for Technical Report 1 by the C++ standard committee's library working group. This proposal is a -revision of paper n1297, n1477, and n1531. +revision of paper n1297, n1477, and n1531. Copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt @@ -127,12 +127,12 @@ requirements in the iterator categories.

*i is convertible to T Forward Iterator -*i is T& (or const T& once issue 200 +*i is T& (or const T& once issue 200 is resolved) Random Access Iterator i[n] is convertible to T (also i[n] = t -is required for mutable iterators once issue 299 +is required for mutable iterators once issue 299 is resolved) @@ -141,7 +141,7 @@ is resolved) single hierarchy, many useful iterators can not be appropriately categorized. For example, vector<bool>::iterator is almost a random access iterator, but the return type is not bool& (see -issue 96 and Herb Sutter's paper J16/99-0008 = WG21 +issue 96 and Herb Sutter's paper J16/99-0008 = WG21 N1185). Therefore, the iterators of vector<bool> only meet the requirements of input iterator and output iterator. This is so nonintuitive that the C++ standard contradicts itself on this point. @@ -344,7 +344,7 @@ approach for specifying operator[ direction would mean that an iterator satisfying the old Random Access Iterator requirements would not necessarily be a model of Readable or Writable Lvalue Iterator. Instead we have chosen a design that -matches the preferred resolution of issue 299: operator[] is +matches the preferred resolution of issue 299: operator[] is only required to return something convertible to the value_type (for a Readable Iterator), and is required to support assignment i[n] = t (for a Writable Iterator).

@@ -976,7 +976,7 @@ struct random_access_traversal_tag : bidirectional_traversal_tag { };

Addition to [lib.iterator.traits]

The is_readable_iterator class -template satisfies the UnaryTypeTrait requirements.

+template satisfies the UnaryTypeTrait requirements.

Given an iterator type X, is_readable_iterator<X>::value yields true if, for an object a of type X, *a is convertible to iterator_traits<X>::value_type, and false @@ -1007,7 +1007,7 @@ otherwise.

Footnotes

-

The UnaryTypeTrait concept is defined in n1519; the LWG is +

The UnaryTypeTrait concept is defined in n1519; the LWG is considering adding the requirement that specializations are derived from their nested ::type.

- - Boost Iterator Traits - - - -C++ Boost -
- -

Boost Iterator Category Traits

-Header boost/iterator_categories.hpp - -

-The boost::traversal_category and -boost::return_category traits classes provides access to the -category tags for iterators that model the Boost Iterator Concepts, which are a -replacement for the iterator requirements in the C++ standard. The -other associated types of the Boost iterator concepts are accessed -through the std::iterator_traits class. - -

    -
  • traversal_category<Iter>::type   Can the iterator go forward, backward, etc.? -
  • return_category<Iter>::type   Is the iterator read or write only? - Is the dereferenced type an lvalue? -
- -

-An important feature of the boost::traversal_category and -boost::return_category classes is that they are backwards -compatible, i.e., they automatically work for iterators for which -there are valid definitions of std::iterator_traits. The old -iterator_category is mapped to the appropriate traversal and -return categories. - -

-When creating a new iterator type that is meant to work with -boost::traversal_category and -boost::return_category, you can either create a -specialization of these classes for your iterator type, or you can -provide all the necessary associated types as nested typedefs. In -this case, your iterator class will need to inherit from -new_iterator_base to let the category traits know -that it will be able to find typedefs for traversal_category -and return_category in you iterator class. - - -Each of the new iterator requirements will need a category tag. - -

-namespace boost {
-
-  // Return Type Categories
-  struct readable_iterator_tag { };
-  struct writable_iterator_tag { };
-  struct swappable_iterator_tag { };
-  struct mutable_lvalue_iterator_tag : virtual public writable_iterator_tag,
-    virtual public readable_iterator_tag { };
-  struct constant_lvalue_iterator_tag : public readable_iterator_tag { };
-
-  // Traversal Categories
-  struct forward_traversal_tag { };
-  struct bidirectional_traversal_tag : public forward_traversal_tag { };
-  struct random_access_traversal_tag : public bidirectional_traversal_tag { };
-
-}
-
- -

-The following is pseudo-code for the iterator category traits classes. - -

-namespace boost {
-
-  // Inherit from iterator_base if your iterator defines its own
-  // return_category and traversal_category. Otherwise, the "old style"
-  // iterator category will be mapped to the return_category and
-  // traversal_category.
-  struct new_iterator_base { };
-
-  template <typename Iterator>
-  struct return_category
-  {
-    // Pseudo-code
-    if (Iterator inherits from new_iterator_base) {
-      typedef typename Iterator::return_category type;
-    } else {
-      typedef std::iterator_traits<Iterator> OldTraits;
-      typedef typename OldTraits::iterator_category Cat;
-      if (Cat inherits from std::forward_iterator_tag)
-	if (is-const(T))
-	  typedef boost::constant_lvalue_iterator_tag type;
-	else
-	  typedef boost::mutable_lvalue_iterator_tag type;
-      else if (Cat inherits from std::input_iterator_tag)
-	typedef boost::readable_iterator_tag type;
-      else if (Cat inherits from std::output_iterator_tag)
-	typedef boost::writable_iterator_tag type;
-    }
-  };
-
-  template <typename T>
-  struct return_category<T*>
-  {
-    // Pseudo-code
-    if (is-const(T))
-      typedef boost::constant_lvalue_iterator_tag type;
-    else
-      typedef boost::mutable_lvalue_iterator_tag type;
-  };
-
-  template <typename Iterator>
-  struct traversal_category
-  {
-    // Pseudo-code
-    if (Iterator inherits from new_iterator_base) {
-      typedef typename Iterator::traversal_category type;
-    } else {
-      typedef std::iterator_traits<Iterator> OldTraits;
-      typedef typename OldTraits::iterator_category Cat;
-
-      if (Cat inherits from std::random_access_iterator_tag)
-	typedef boost::random_access_traversal_tag type;
-      else if (Cat inherits from std::bidirectional_iterator_tag)
-	typedef boost::bidirectional_traversal_tag type;
-      else if (Cat inherits from std::forward_iterator_tag)
-	typedef boost::forward_traversal_tag type;
-    }
-  };
-
-  template <typename T>
-  struct traversal_category<T*>
-  {
-    typedef boost::random_access_traversal_tag type;
-  };
-
-}
-
- -
-
jeremy siek
- - -Last modified: Mon Mar 19 12:59:30 EST 2001 - - - diff --git a/development/libs/iterator/iterator_concepts.fig b/development/libs/iterator/iterator_concepts.fig deleted file mode 100644 index 198205e..0000000 --- a/development/libs/iterator/iterator_concepts.fig +++ /dev/null @@ -1,37 +0,0 @@ -#FIG 3.2 -Landscape -Center -Inches -Letter -100.00 -Single --2 -1200 2 -6 150 2325 4275 4350 -2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1725 4050 1725 3450 -2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 1725 3150 1725 2550 -4 0 0 100 0 19 18 0.0000 4 210 3180 375 2550 ForwardTraversalIterator\001 -4 0 0 100 0 19 18 0.0000 4 210 3765 225 3450 BidirectionalTraversalIterator\001 -4 0 0 100 0 19 18 0.0000 4 210 4125 150 4350 RandomAccessTraversalIterator\001 --6 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 4800 3600 4800 2400 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 6900 3000 5400 2400 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 6900 3000 7500 2400 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 1 1 1.00 60.00 120.00 - 6900 3000 9075 2475 -4 0 0 100 0 19 18 0.0000 4 210 2040 6600 2400 WritableIterator\001 -4 0 0 100 0 19 18 0.0000 4 210 2145 3900 2400 ReadableIterator\001 -4 0 0 50 0 19 18 0.0000 4 210 2835 5700 3300 MutableLvalueIterator\001 -4 0 0 50 0 19 18 0.0000 4 270 2355 9075 2400 SwappableIterator\001 -4 0 0 50 0 19 18 0.0000 4 210 2970 3825 3900 ConstantLvalueIterator\001 diff --git a/development/libs/iterator/iterator_concepts.gif b/development/libs/iterator/iterator_concepts.gif deleted file mode 100644 index bac35c7d13e402c6bc2fd5ff770bf444da6f4426..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3287 zcmZ?wbh9u|{K7PWp@9Je{{R241EN793{3xe`d6NQ%fEQemRsGM@9p``-}cC3+Oy7O zuTE`y$DMw_=klVzXL#Q|VEEbXS-~i0_;B_MiQ}$CA|giF-kExpm{6 zWxB+5$>mpC(P666Jzw76k)405yHdSw{l{-fY8qRwZ5IvA*r@UR2ggmPD;6ysDUlxR ztP)|%PgF`4a-90U(=)6%{buLRss)wKQkLG)uM3~tEG_#v`S!Nezh-IO+07kuYWc6{ z-gDMGGUkcx$ywIp`omi$JvesP+QX)A_SW#~bsJ{Ng{0qo_EzuSy1D;6?f1!@@0}n0 z-!_-qV1Yx*&39kB-7@AI<{acPi{@Apb*S+3iMg*8bYooqWpV8G%{eh4*{zPP`=fQm z#6a!V@-@9SoklU{O^RRlxJS;oM84^F!j6MJ>yd6 z`?ganL!Rwh6g}Oo_0`nXp~8ws!$ePRT6}Vij;mJkEz_wMD@tbn+tV%X~(W)m$dY>f>zhP zsWB?uxpwCFlX^T>OK&_m9c+u}`p)cP~zn!}5;__MbF`iHQ8xCq_#I=gW87vTcb0b(h{!nUJwBv!&>GF-2RvwK@ zRG!y%RYOayNw)J%Z~Mb?wpUjaJFZ7=o7$b|$Ud{@*WFJOm2Z2xde=Dc2tDjdQ)FEl zl)muVtlIyvKSRCZR;VuO3e4K7JXMFSZRr&GV?mE3iyKd-&d!1}E3an-U$H|{md9^8=DS^RFvgqBXLsMN)KKOT>m7!%}` zxl|+X*Zsvyqn57>>tSQkSR(vL^Vs|iP6{ukO%e+aUbsun`O=(4cGI*hW4%7HPuQnr z_3v_5{a%(e%g?mj&|JSlZkGS1D{QT|H{RSeef5R|n@)9ZVfR~gIc;6*jfkDcLVx#f zeWSNxRnn&%?RCcDr@~(Ez4X$$yZ_IrebtbN!^7UR__L_$mulBw+h~SWq4b0sV zx_9-`<@Y2Nt~53OlbvvW`JdRuPoHYG@4Q;J##;WNrP>PaM}FsC7d9+Ed^WR3F0E@- zW$o^+@8@Too>%yMBkRAkm)hUg{W=r!x_rXx!|~r&Jn?H>XY}FwIX#xAQO#o8=IzQq z_j_r6Z)wJppuMwy)Z9CKZ^tL@*{=+i&8&*6-g4dg6n6*eiUEaE9&enizv(ARHH(m$S66|Ra*AN9;PFA|SjcvSz@)5?fF{p^c1j+x}G z?a6XslL`^<47on@1H&6`9;L#IOqd_@ywEL4=4 zFCI{|d(_{*MkQJ2gWoBEB8D6848WC_SKsOuAHRW#Q;6*A9#YP3qK=1c)w|4l{H zEEhZ#Uf=G;W2iZO+nZF~+RWB)wNG6NQ&bK5XR@Za={N0p!+5@BrB9U8=NXsx+?HPL zaWW%oGtX_4WcJxJO|;62=QOFLTl#vq^Oaqk^Tx&5`mTqw>m%LS@7FB9@uu>mtlEd9 zFGrT!w|_V9Weod#0TVVKZjcP$&++JZD$Pa_a{x{kLWYMYDZf z?o#_8AieU+BCV~(o}sD1)48s$vkjdR+`B5&GVH2<+SgSvXCH=czjbv(*N4^4F8w+( zTpd0qj9dH#Rzw7IT=QxQjcE#cef^x&vD=b)+4-*Ok!vLt_prTM*SvM+-2}rG`?SQG zidi2l5fHUnyzp(x)LFAOb+su~uFOu7>3W@HzuNnN*m+NZ*Jpo5rRiM$l%bv@DC(!e z=5VyJY+JHuu6NC0t8E+~j9v%_P8GU*bK4U$@0v*6!pwi&cg{vm&dqkbsofGb_2OAx z3;*oME3?Y=*s50MJn&gp?zkhSSmOGcC)s*6F<(|ao;q> z-F0jitQC8H^Qn%ee)QDIE&EksSdZ#0O%2-EyjDru>R{$}5iafLHwuV<@bWWOUv!;dhN1-(1<_TWEZ+(4oy*}CI%fik#o5W7)T(L5`(f#TA zlH+#IJy*=VR3FK1{AXXE*4i&$8arhki%-0^D^_jhcNa z;1<)SgXRfu+O)DuS4yV_%HH2;*n3jsRK%hLUGw*>CvR;n+g5)6PHxJ3wnNrjlUHr% zHA(O7+P|jNWQTg}j<1Hd1)eR_-<7)N-TB$X>MFMFYO=d+$CG(!I0I+3WIDW$`Np7r$=n^LuZ-+U$ny@txbcZ>Lu;u59Qpd()<__hn7? z-kZ_ycOCur>g$I2f^U-at0Pb5ecO_6aHKnB_pRN0CB?h`zKuMd;qu(?`_$XAiz?1n z@BhB;!oJ^kZ@zxA@&UVl#S!hekL~e$9`oP&aoqdfyovMoJbhaC^Gx>MPqW_JnA-AJ zMHkQOZt&M|UEgOYJNqX0!tc*tY>b)adnWkdD*wNI+4rl;_T4)kaNTIN4bPUt>#R2J ztbhLQ^sC($w^>Iwl=<$+jf>>tpJnw~Y0HAWsp}ps|Ma8o&$%C~)@7MoxP4@UFZjDSCjb=d!oW~nq zOwO(fC^=FVca~Yfi!Hw}yh+NW@i0rQzFE4iMy!RJy`FR8(qnm2vb~fnVi#>FlE}b+xza&ish)E z_9XW~ab&z(@w^Mkw~g!AL?YLH)?T8VQCC)-C*k3((b38g-qz94Hoc?UBDm#5M}LR+ z1dUF~ryY|sIxiP@&ivs&b;ZBVxhwSNyy#r0VZF$sYiUN;@{X>RE4o&n=vw=tYduHz zMvd;x9^G3zLarSS-!whs^|R#KgPz+og614fezZk>$BO3aR>8ZhJ$_#cPkOktrh8~l zN!_@iN2;~p{Uw=~%j!LZ+OsCt+~3j8Jw4s=heD%Uc+icSo8`5q+%v99`2KIp{CzOv za$9fX*36g7iyys+`%xx5HOy{jYvwu~4l!|Ot*od3!3LdZD^E69ya&Co$ z>BECrM@1*zUfSyTqFFV0!ut#}jujL9E%GjH&*gksqqC?#XmK=uhROL<3C0xFLvC3& zzfNTLEJ@@j_~Fo``$IWgUH-@Ac<$+GXAW(xd-SbD$}*S5sL8ovvTCcv-OG6=*(OS8 zPIaklPsp&UlZf{Aj7wTE#dcep_4XQn&Z!bN8iH5$emFO(|mld_@&1}^TORl@=ea5-% zPFjjvMwo$l{-f&}6*o$*7PfuknD*GU_~53QF&Q%rS#nEf#4r3@AX66QakK8-q2B0B avv|wt|F#w{F3RO$?#R71Ygz~cgEatv^I|Fh diff --git a/development/libs/iterator/iterator_concepts.htm b/development/libs/iterator/iterator_concepts.htm deleted file mode 100644 index f2f8dcd..0000000 --- a/development/libs/iterator/iterator_concepts.htm +++ /dev/null @@ -1,663 +0,0 @@ - - - - -Iterator Concepts - -C++ Boost - -
- - -

Iterator Concepts

- -

The standard iterator categories and requirements are flawed because -they use a single hierarchy of requirements to address two orthogonal -issues: iterator traversal and dereference return -type. The current iterator requirement hierarchy is mainly -geared towards iterator traversal (hence the category names), while -requirements that address dereference return type sneak in at various -places. - -

-The iterator requirements should be separated into two hierarchies. -One set of concepts handles the return type semantics: -

- -The other set of concepts handles iterator traversal: - - - -The current Input Iterator and Output Iterator requirements will -continue to be used as is. Note that Input Iterator implies Readable -Iterator and Output Iterator implies Writable Iterator. - -

-Note: we considered defining a Single-Pass Iterator, which could be -combined with Readable or Writable Iterator to replace the Input and -Output Iterator requirements. We rejected this idea because there are -some differences between Input and Output Iterators that make it hard -to merge them: for example Input Iterator requires Equality Comparable -while Output Iterator does not. - - -

-
- - - -
Figure 1: -The iterator concepts and refinement relationships. -
-
-

- - -

Relationship with the standard iterator concepts

- -

-std::Input Iterator implies boost::ReadableIterator. - -

-std::Output Iterator implies boost::Writable Iterator. - -

-std::Forward Iterator refines boost::Forward Iterator and -boost::Constant Lvalue Iterator or boost::Mutable Lvalue Iterator. - -

-std::Bidirectional Iterator refines boost::Bidirectional Iterator and -boost::Constant Lvalue Iterator or boost::Mutable Lvalue Iterator. - -

-std::Random Access Iterator refines boost::Random Access Iterator and -boost::Constant Lvalue Iterator or boost::Mutable Lvalue Iterator. - - -

Notation

- - - - - - - - - - - - - - - - - -
XThe iterator type.
TThe value type of X, i.e., std::iterator_traits<X>::value_type.
x, yAn object of type X.
tAn object of type T.
- -

- -


- - -

-Readable Iterator -

- -A Readable Iterator is an iterator that dereferences to produce an -rvalue that is convertible to the value_type of the -iterator. - -

Associated Types

- - - - - - - - - - - - - - - - - - - - - -
Value typestd::iterator_traits<X>::value_typeThe type of the objects pointed to by the iterator.
Reference typestd::iterator_traits<X>::reference - The return type of dereferencing the iterator. This - type must be convertible to T. -
Return Categorystd::return_category<X>::type - A type convertible to std::readable_iterator_tag -
- -

Refinement of

- -Copy Constructible - -

Valid expressions

- - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Dereference*x std::iterator_traits<X>::reference
Member accessx->mT is a type with a member named m. -If m is a data member, the type of m. -If m is a member function, the return type of m. -
- -

- -


- - -

-Writable Iterator -

- -A Writable Iterator is an iterator that can be used to store a value -using the dereference-assignment expression. - -

Definitions

- -If x is an Writable Iterator of type X, then the -expression *x = a; stores the value a into -x. Note that operator=, like other C++ functions, -may be overloaded; it may, in fact, even be a template function. In -general, then, a may be any of several different types. A -type A belongs to the set of value types of X -if, for an object a of type A, *x = a; is -well-defined and does not require performing any non-trivial -conversions on a. - -

Associated Types

- - - - - - - - - -
Return Categorystd::return_category<X>::type - A type convertible to std::writable_iterator_tag -
- - - -

Refinement of

- -Copy Constructible - -

Valid expressions

- - - - - - - - - - -
NameExpressionReturn type
Dereference assignment*x = aunspecified
- -

- - -


- - -

-Swappable Iterator -

- -A Swappable Iterator is an iterator whose dereferenced values can be -swapped. - -

-Note: the requirements for Swappable Iterator are dependent on the -issues surrounding std::swap() being resolved. Here we assume -that the issue will be resolved by allowing the overload of -std::swap() for user-defined types. - -

-Note: Readable Iterator and Writable Iterator combined implies -Swappable Iterator because of the fully templated -std::swap(). However, Swappable Iterator does not imply -Readable Iterator nor Writable Iterator. - -

Associated Types

- - - - - - - - - -
Return Categorystd::return_category<X>::type - A type convertible to std::swappable_iterator_tag -
- - -

Valid expressions

- -Of the two valid expressions listed below, only one OR the -other is required. If std::iter_swap() is overloaded for -X then std::swap() is not required. If -std::iter_swap() is not overloaded for X then the -default (fully templated) version is used, which will call -std::swap() (this means changing the current requirements for -std::iter_swap()). - -

- - - - - - - - - - - - - - - - - -
NameExpressionReturn type
Iterator Swapstd::iter_swap(x, y)void
Dereference and Swapstd::swap(*x, *y)void
- -

- - -


- - -

-Constant Lvalue Iterator -

- -A Constant Lvalue Iterator is an iterator that dereferences to produce a -const reference to the pointed-to object, i.e., the associated -reference type is const T&. Changing the value -of or destroying an iterator that models Constant Lvalue Iterator does -not invalidate pointers and references previously obtained from that -iterator. - - -

Refinement of

- -Readable Iterator - -

Associated Types

- - - - - - - - - - - - - - - - - -
Reference typestd::iterator_traits<X>::reference - The return type of dereferencing the iterator, which must be - const T&. -
Return Categorystd::return_category<X>::type - A type convertible to std::constant_lvalue_iterator_tag -
- - - -

- -


- - -

-Mutable Lvalue Iterator -

- -A Mutable Lvalue Iterator is an iterator that dereferences to produce a -reference to the pointed-to object. The associated reference -type is T&. Changing the value of or destroying an -iterator that models Mutable Lvalue Iterator does not invalidate -pointers and references previously obtained from that iterator. - -

Refinement of

- -Readable Iterator, -Writable Iterator, -and Swappable Iterator. - - - -

Associated Types

- - - - - - - - - - - - - - - - - -
Reference typestd::iterator_traits<X>::referenceThe return type of dereferencing the iterator, which must be - T&.
Return Categorystd::return_category<X>::type - A type convertible to std::mutable_lvalue_iterator_tag -
- - - -

-


- - -

-Forward Traversal Iterator -

- -The Forward Iterator is an iterator that can be incremented. Also, it -is permissible to make multiple passes through the iterator's range. - -

Refinement of

- -Copy Constructible, -Assignable, -Default Constructible, and -Equality Comparable - - -

Associated types

- - - - - - - - - - - - - - -
Difference Typestd::iterator_traits<X>::difference_type - A signed integral type used for representing distances - between iterators that point into the same range. -
Traversal Categorystd::traversal_category<X>::type - A type convertible to std::forward_traversal_tag -
- -

Valid expressions

- - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Preincrement++i X&
Postincrementi++ convertible to const X&
- -

-


- - -

-Bidirectional Traversal Iterator -

- -An iterator that can be incremented and decremented. - -

Refinement of

- -Forward Traversal Iterator - -

Associated types

- - - - - - - -
Traversal Categorystd::traversal_category<X>::type - A type convertible to std::bidirectional_traversal_tag -
- -

Valid expressions

- - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Predecrement--i X&
Postdecrementi-- convertible to const X&
- -

-


- - -

-Random Access Traversal Iterator -

- -An iterator that provides constant-time methods for moving forward and -backward in arbitrary-sized steps. - -

Refinement of

- -Bidirectional Traversal Iterator and -Less Than Comparable where < is a total ordering - -

Associated types

- - - - - - - -
Traversal Categorystd::traversal_category<X>::type - A type convertible to std::random_access_traversal_tag -
- -

Valid expressions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameExpressionType requirementsReturn type
Iterator additioni += n X&
Iterator additioni + n or n + i X
Iterator subtractioni -= n X&
Iterator subtractioni - n X
Differencei - j std::iterator_traits<X>::difference_type
Element operatori[n]X must also be a model of - Readable Iterator. std::iterator_traits<X>::reference
Element assignmenti[n] = tX must also be a model of - Writable Iterator.unspecified
- -

- -


- - -
Copyright © 2000 -Jeremy Siek, Univ.of Notre Dame (jsiek@lsc.nd.edu) -
- - -