boost::transform_iterator, boost::array::iterator and category

Hello,
I have boost::array< pair
From the docs http://www.boost.org/doc/libs/1_38_0/libs/iterator/doc/transform_iterator.ht ml
If Iterator models Readable Lvalue Iterator and if Iterator models "Random Access Traversal Iterator", then iterator_category is convertible to random_access_iterator_tag. Any ideas, Regards,

AMDG Hicham Mouline wrote:
typedef transform_iterator< UnaryFunction, ... > iteratorIntoFirst;
struct UnaryFunction: public std::unary_function< pair
, double> { double operator()( const pair & e ) const { return e.first; } } However on asserting the category is still random access, boost static assert fails: <snip>
Try returning a reference const double& instead of double.
struct UnaryFunction {
typedef const double& result_type;
const double& operator()( const pair
participants (2)
-
Hicham Mouline
-
Steven Watanabe