$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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.