diff --git a/include/boost/iterator/counting_iterator.hpp b/include/boost/iterator/counting_iterator.hpp index 42b4c1d..f89e7a4 100755 --- a/include/boost/iterator/counting_iterator.hpp +++ b/include/boost/iterator/counting_iterator.hpp @@ -71,7 +71,7 @@ namespace detail struct counting_iterator_base { typedef typename mpl::apply_if< - is_same + is_same , mpl::apply_if< is_numeric , mpl::identity @@ -81,7 +81,7 @@ namespace detail >::type category; typedef typename mpl::apply_if< - is_same + is_same , mpl::apply_if< is_numeric , numeric_difference @@ -129,7 +129,7 @@ namespace detail }; } -template +template class counting_iterator : public detail::counting_iterator_base::type { diff --git a/include/boost/iterator/filter_iterator.hpp b/include/boost/iterator/filter_iterator.hpp index c3d38f3..b8a53bf 100644 --- a/include/boost/iterator/filter_iterator.hpp +++ b/include/boost/iterator/filter_iterator.hpp @@ -35,13 +35,13 @@ namespace boost class filter_iterator : public iterator_adaptor< filter_iterator, Iterator - , not_specified + , use_default , typename detail::filter_iterator_category::type > { typedef iterator_adaptor< filter_iterator, Iterator - , not_specified + , use_default , typename detail::filter_iterator_category::type > super_t; diff --git a/include/boost/iterator/indirect_iterator.hpp b/include/boost/iterator/indirect_iterator.hpp index 372dc5d..a0c903b 100644 --- a/include/boost/iterator/indirect_iterator.hpp +++ b/include/boost/iterator/indirect_iterator.hpp @@ -154,11 +154,11 @@ namespace boost template < class Iterator - , class Value = not_specified - , class Category = not_specified - , class Reference = not_specified - , class Pointer = not_specified - , class Difference = not_specified + , class Value = use_default + , class Category = use_default + , class Reference = use_default + , class Pointer = use_default + , class Difference = use_default > class indirect_iterator : public detail::indirect_base< diff --git a/include/boost/iterator/iterator_adaptor.hpp b/include/boost/iterator/iterator_adaptor.hpp index aaeb62d..9e44b94 100644 --- a/include/boost/iterator/iterator_adaptor.hpp +++ b/include/boost/iterator/iterator_adaptor.hpp @@ -172,7 +172,7 @@ namespace boost struct ia_dflt_help : mpl::apply_if< mpl::and_< - is_same + is_same , Condition > , DefaultNullaryFn @@ -194,11 +194,11 @@ namespace boost { typedef iterator_facade< Derived - , typename detail::ia_dflt_help >::type - , typename detail::ia_dflt_help >::type - , typename detail::ia_dflt_help , iterator_reference >::type - , typename detail::ia_dflt_help , iterator_pointer >::type - , typename detail::ia_dflt_help >::type + , typename detail::ia_dflt_help >::type + , typename detail::ia_dflt_help >::type + , typename detail::ia_dflt_help , iterator_reference >::type + , typename detail::ia_dflt_help , iterator_pointer >::type + , typename detail::ia_dflt_help >::type > type; }; @@ -211,11 +211,11 @@ namespace boost template < class Derived , class Base - , class Value = not_specified - , class Category = not_specified - , class Reference = not_specified - , class Pointer = not_specified - , class Difference = not_specified + , class Value = use_default + , class Category = use_default + , class Reference = use_default + , class Pointer = use_default + , class Difference = use_default > class iterator_adaptor : public detail::iterator_adaptor_base< diff --git a/include/boost/iterator/iterator_facade.hpp b/include/boost/iterator/iterator_facade.hpp index 798c0ce..4c6293c 100644 --- a/include/boost/iterator/iterator_facade.hpp +++ b/include/boost/iterator/iterator_facade.hpp @@ -29,7 +29,7 @@ namespace boost { - struct not_specified; + struct use_default; namespace detail { @@ -67,6 +67,12 @@ namespace boost // Generates the corresponding std::iterator specialization // from the given iterator traits type // + // The use_default support is needed for iterator_adaptor. + // For practical reasons iterator_adaptor needs to specify + // fixed number of template arguments of iterator_facade. + // So use_default is its way to say what I really mean + // is youre default parameter. + // template struct iterator_facade_base { @@ -78,13 +84,13 @@ namespace boost , Difference , typename mpl::if_< - is_same + is_same , Value* , Pointer >::type , typename mpl::if_< - is_same + is_same , Value& , Reference >::type @@ -263,9 +269,9 @@ namespace boost class Derived , class Value , class Category - , class Reference = not_specified - , class Pointer = not_specified - , class Difference = not_specified + , class Reference = Value& + , class Pointer = Value* + , class Difference = std::ptrdiff_t > class iterator_facade : public detail::iterator_facade_base::type diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp index 497d64f..2bd982a 100644 --- a/include/boost/iterator/transform_iterator.hpp +++ b/include/boost/iterator/transform_iterator.hpp @@ -24,16 +24,22 @@ namespace boost namespace detail { + // Given the transform iterator's transformation and iterator, this // is the type used as its traits. template struct transform_iterator_base { private: + + // transform_iterator does not support writable/swappable iterators +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + BOOST_STATIC_ASSERT((is_tag< readable_iterator_tag, typename access_category::type >::value)); +#endif + typedef typename UnaryFunction::result_type result_type; typedef typename remove_reference< result_type >::type cv_value_type; - typedef typename remove_cv< cv_value_type >::type value_type; typedef typename mpl::if_< is_reference< result_type > @@ -62,6 +68,7 @@ namespace boost , result_type > type; }; + } template