From eb288b2908abcb646b8a9e167eaae7aa373f6b40 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 26 Sep 2013 09:43:37 +0000 Subject: [PATCH 1/7] 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 d8144234145c857b3f535172917a1fc1124f6a4b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 15:54:03 +0000 Subject: [PATCH 2/7] 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 0345db959bf606cc80bd9848df82bdffa5772a8d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 15:54:32 +0000 Subject: [PATCH 3/7] 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 6883d083d23c126c951fca6052f60f5dd624596d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 30 Sep 2013 16:04:19 +0000 Subject: [PATCH 4/7] Iterator: Remove obsolete MSVC version checks. [SVN r86082] Conflicts: include/boost/iterator/iterator_facade.hpp --- 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 | 55 +------------------ include/boost/iterator/iterator_traits.hpp | 32 ----------- include/boost/iterator/transform_iterator.hpp | 7 --- include/boost/iterator/zip_iterator.hpp | 15 ----- 13 files changed, 6 insertions(+), 197 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 04b393a..2572db0 100644 --- a/include/boost/iterator/detail/facade_iterator_category.hpp +++ b/include/boost/iterator/detail/facade_iterator_category.hpp @@ -132,7 +132,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. @@ -148,7 +147,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 @@ -156,9 +154,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 d84b402..d08b2ba 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -65,18 +65,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 @@ -85,7 +73,6 @@ namespace boost , Return > {}; -#endif // // Generates associated types for an iterator_facade with the @@ -325,15 +312,6 @@ namespace boost } }; -# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - // Deal with ETI - template<> - 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) @@ -408,13 +386,7 @@ 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 +# else mpl::eval_if< is_convertible , iterator_difference @@ -661,17 +633,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()); @@ -702,21 +663,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++( @@ -731,7 +679,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 187bc896f66ac772c75383f63829cc4fe96c7d3a Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 4 Jun 2014 12:55:03 +0100 Subject: [PATCH 5/7] BOOST_ITERATOR_CATEGORY shouldn't be removed. Since it was documented, it should be kept for backwards compatiblity. --- include/boost/iterator/iterator_traits.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/iterator/iterator_traits.hpp b/include/boost/iterator/iterator_traits.hpp index 856641c..39e08c0 100644 --- a/include/boost/iterator/iterator_traits.hpp +++ b/include/boost/iterator/iterator_traits.hpp @@ -10,7 +10,8 @@ namespace boost { -// Obsolete. Remove. +// Macro for supporting old compilers, no longer needed but kept +// for backwards compatibility (it was documented). #define BOOST_ITERATOR_CATEGORY iterator_category From 01cffbed9801fcde182ffab60a557065b1883e5e Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 4 Jun 2014 12:55:03 +0100 Subject: [PATCH 6/7] Rebuild iterator_traits.html using latest docutils. --- doc/iterator_traits.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/iterator_traits.html b/doc/iterator_traits.html index 7bd6119..cdefe83 100755 --- a/doc/iterator_traits.html +++ b/doc/iterator_traits.html @@ -3,11 +3,11 @@ - + Iterator Traits - + @@ -25,7 +25,7 @@ Organization: Boost Consulting Date: -2006-09-11 +$Date$ Copyright: Copyright David Abrahams 2004. @@ -37,7 +37,7 @@ -abstract:Header <boost/iterator/iterator_traits.hpp> provides +abstract:Header <boost/iterator/iterator_traits.hpp> provides the ability to access an iterator's associated types using MPL-compatible metafunctions. @@ -46,15 +46,15 @@ MPL-compatible

Overview

std::iterator_traits provides access to five associated types -of any iterator: its value_type, reference, pointer, -iterator_category, and difference_type. Unfortunately, +of any iterator: its value_type, reference, pointer, +iterator_category, and difference_type. Unfortunately, such a "multi-valued" traits template can be difficult to use in a -metaprogramming context. <boost/iterator/iterator_traits.hpp> +metaprogramming context. <boost/iterator/iterator_traits.hpp> provides access to these types using a standard metafunctions.

Summary

-

Header <boost/iterator/iterator_traits.hpp>:

+

Header <boost/iterator/iterator_traits.hpp>:

 template <class Iterator>
 struct iterator_value
@@ -106,11 +106,11 @@ your compiler's standard library.

On compilers that don't support partial specialization, such as Microsoft Visual C++ 6.0 or 7.0, you may need to manually invoke BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION on the -value_type of pointers that are passed to these metafunctions.

+value_type of pointers that are passed to these metafunctions.

Because of bugs in the implementation of GCC-2.9x, the name of -iterator_category is changed to iterator_category_ on that -compiler. A macro, BOOST_ITERATOR_CATEGORY, that expands to -either iterator_category or iterator_category_, as +iterator_category is changed to iterator_category_ on that +compiler. A macro, BOOST_ITERATOR_CATEGORY, that expands to +either iterator_category or iterator_category_, as appropriate to the platform, is provided for portability.

From e88b3f475c0f642cd8fe6535485e843643d77f3e Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 4 Jun 2014 12:55:03 +0100 Subject: [PATCH 7/7] Remove the the broken compiler notes. Now that the workarounds have been removed, they no longer apply. --- doc/iterator_traits.html | 15 --------------- doc/iterator_traits.rst | 21 --------------------- doc/quickbook/traits.qbk | 19 +------------------ 3 files changed, 1 insertion(+), 54 deletions(-) diff --git a/doc/iterator_traits.html b/doc/iterator_traits.html index cdefe83..ed89241 100755 --- a/doc/iterator_traits.html +++ b/doc/iterator_traits.html @@ -98,21 +98,6 @@ struct iterator_category }; -
-

Broken Compiler Notes

-

Because of workarounds in Boost, you may find that these -metafunctions actually work better than the facilities provided by -your compiler's standard library.

-

On compilers that don't support partial specialization, such as -Microsoft Visual C++ 6.0 or 7.0, you may need to manually invoke -BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION on the -value_type of pointers that are passed to these metafunctions.

-

Because of bugs in the implementation of GCC-2.9x, the name of -iterator_category is changed to iterator_category_ on that -compiler. A macro, BOOST_ITERATOR_CATEGORY, that expands to -either iterator_category or iterator_category_, as -appropriate to the platform, is provided for portability.

-