diff --git a/doc/transform_iterator.html b/doc/transform_iterator.html index ed69c45..2281737 100644 --- a/doc/transform_iterator.html +++ b/doc/transform_iterator.html @@ -99,7 +99,7 @@ private:

If Reference is use_default then the reference member of transform_iterator is -result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type. +result_of<const UnaryFunction(iterator_traits<Iterator>::reference)>::type. Otherwise, reference is Reference.

If Value is use_default then the value_type member is remove_cv<remove_reference<reference> >::type. Otherwise, @@ -117,10 +117,10 @@ convertible to input_iterator_tag

transform_iterator requirements

The type UnaryFunction must be Assignable, Copy Constructible, and -the expression f(*i) must be valid where f is an object of +the expression f(*i) must be valid where f is a const object of type UnaryFunction, i is an object of type Iterator, and where the type of f(*i) must be -result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type.

+result_of<const UnaryFunction(iterator_traits<Iterator>::reference)>::type.

The argument Iterator shall model Readable Iterator.

diff --git a/doc/transform_iterator_ref.rst b/doc/transform_iterator_ref.rst index 74347a0..70becc5 100644 --- a/doc/transform_iterator_ref.rst +++ b/doc/transform_iterator_ref.rst @@ -41,7 +41,7 @@ If ``Reference`` is ``use_default`` then the ``reference`` member of ``transform_iterator`` is -``result_of::reference)>::type``. +``result_of::reference)>::type``. Otherwise, ``reference`` is ``Reference``. If ``Value`` is ``use_default`` then the ``value_type`` member is @@ -64,10 +64,10 @@ convertible to ``input_iterator_tag``. ................................... The type ``UnaryFunction`` must be Assignable, Copy Constructible, and -the expression ``f(*i)`` must be valid where ``f`` is an object of +the expression ``f(*i)`` must be valid where ``f`` is a const object of type ``UnaryFunction``, ``i`` is an object of type ``Iterator``, and where the type of ``f(*i)`` must be -``result_of::reference)>::type``. +``result_of::reference)>::type``. The argument ``Iterator`` shall model Readable Iterator. diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp index 86565b8..b79a440 100644 --- a/include/boost/iterator/transform_iterator.hpp +++ b/include/boost/iterator/transform_iterator.hpp @@ -46,7 +46,7 @@ namespace boost // the function. typedef typename ia_dflt_help< Reference - , result_of::reference)> + , result_of::reference)> >::type reference; // To get the default for Value: remove any reference on the diff --git a/test/transform_iterator_test.cpp b/test/transform_iterator_test.cpp index 255eab4..3caad2a 100644 --- a/test/transform_iterator_test.cpp +++ b/test/transform_iterator_test.cpp @@ -12,6 +12,7 @@ // Moved test of transform iterator into its own file. It to // to be in iterator_adaptor_test.cpp. +#include #include #include #include @@ -106,12 +107,17 @@ struct polymorphic_mult_functor { //Implement result_of protocol template struct result; - template struct result {typedef T type;}; - template struct result {typedef T type;}; - template struct result {typedef T type;}; + template struct result {typedef T type;}; + template struct result {typedef T type;}; + template struct result {typedef T type;}; + template struct result {typedef void type;}; + template struct result {typedef void type;}; + template struct result {typedef void type;}; template T operator()(const T& _arg) const {return _arg*2;} + template + void operator()(const T& _arg) { BOOST_ASSERT(0); } }; int