Boost logo

Boost :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2002-01-11 04:51:51


Should'nt the dereference() in the policies return a const_reference
instead of a reference ?

I'm using a projection_iterator to navigate over a sequence and my
UnaryFunction returns a const reference. This results in a compiler
error (gcc-3.0.3).

Particular in the case of the projection_iterator, the 'function' is a
one way function (able to convert the real content to the iterator's
value_type and not vice-versa, thus the iterator can never be writeable)
and thus only a 'dereference() const' is possible returning a
const_reference IMHO ?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk