diff --git a/doc/facade-and-adaptor.html b/doc/facade-and-adaptor.html index 32716a4..1521731 100755 --- a/doc/facade-and-adaptor.html +++ b/doc/facade-and-adaptor.html @@ -1647,6 +1647,7 @@ base iterator, passes the result of this to the function object, and then returns the result.

Class template transform_iterator

+
 template <class UnaryFunction,
           class Iterator, 
@@ -1660,10 +1661,11 @@ public:
   transform_iterator();
   transform_iterator(Iterator const& x, UnaryFunction f);
 
-  template<class OtherIterator, class R2, class V2>
+  template<class F2, class I2, class R2, class V2>
   transform_iterator(
-        transform_iterator<UnaryFunction, OtherIterator, R2, V2> const& t
-      , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0 // exposition
+        transform_iterator<F2, I2, R2, V2> const& t
+      , typename enable_if_convertible<I2, Iterator>::type* = 0      // exposition
+      , typename enable_if_convertible<F2, UnaryFunction>::type* = 0 // exposition
   );
 
   UnaryFunction functor() const;
@@ -2132,7 +2134,7 @@ LocalWords:  OtherIncrementable Coplien -->
 
 
 
diff --git a/include/boost/iterator/transform_iterator.hpp b/include/boost/iterator/transform_iterator.hpp
index 3474ccf..1cd0438 100644
--- a/include/boost/iterator/transform_iterator.hpp
+++ b/include/boost/iterator/transform_iterator.hpp
@@ -111,12 +111,18 @@ namespace boost
 #endif 
     }
 
-    template
+    template<
+        class OtherUnaryFunction
+      , class OtherIterator
+      , class OtherReference
+      , class OtherValue>
     transform_iterator(
-         transform_iterator const& t
+         transform_iterator const& t
        , typename enable_if_convertible::type* = 0
+       , typename enable_if_convertible::type* = 0
     )
-      : super_t(t.base()), m_f(t.functor()) {}
+      : super_t(t.base()), m_f(t.functor())
+   {}
 
     UnaryFunction functor() const
       { return m_f; }
diff --git a/test/transform_iterator_test.cpp b/test/transform_iterator_test.cpp
index f044add..2c9139a 100644
--- a/test/transform_iterator_test.cpp
+++ b/test/transform_iterator_test.cpp
@@ -59,7 +59,18 @@ struct adaptable_mult_functor
 };
 
 
+struct const_select_first
+{
+  typedef int const& result_type;
+
+  int const& operator()(std::pairconst& p) const
+  {
+    return p.first;
+  }
+};
+
 struct select_first
+  : const_select_first // derivation to allow conversions
 {
   typedef int& result_type;
 
@@ -79,16 +90,6 @@ struct select_second
   }
 };
 
-struct const_select_first
-{
-  typedef int const& result_type;
-
-  int const& operator()(std::pairconst& p) const
-  {
-    return p.first;
-  }
-};
-
 struct value_select_first
 {
   typedef int result_type;
@@ -237,8 +238,12 @@ main()
         boost::make_transform_iterator((pair_t*)values, const_select_first()), x[0]); 
 
     boost::non_const_lvalue_iterator_test(
-        boost::make_transform_iterator((pair_t*)values, select_first()), x[0], 17); 
+        boost::make_transform_iterator((pair_t*)values, select_first()), x[0], 17);
 
+    boost::const_nonconst_iterator_test(
+        ++boost::make_transform_iterator((pair_t*)values, select_first())
+      , boost::make_transform_iterator((pair_t*)values, const_select_first())
+    );
   }
 
   std::cout << "test successful " << std::endl;