Boost logo

Boost Users :

Subject: [Boost-users] transform_iterator::reference
From: Matwey V. Kornilov (matwey.kornilov_at_[hidden])
Date: 2011-01-06 10:48:46


Hi,

Boost 1.42.0 documentation of transfrom_iterator says: "If Reference is
use_default then the reference member of transform_iterator is
result_of<UnaryFunction(iterator_traits<Iterator>::reference)>::type.
Otherwise, reference is Reference." But it is simply implemented as
UnaryFunction::result_type;

This discrepancy between documentation and implementation plays a role when
I want to use transform_iterator with boost::mem_fn to access member
variable of structure.

mem_fn's operator() is overridden to provide both const and non-const access
to member variable. The discrepancy leads to compilation error for non-const
access.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net