
14 Jan
2010
14 Jan
'10
12:47 p.m.
Phil Endecott wrote:
Dear All,
But what do I do about the reference type? I can't use std::pair<const KEY,VALUE>& because I'm not storing the keys and values in that way. It's almost possible to use std::pair<KEY,VALUE> for a const_iterator, but not if you want to allow the user to change the value through the reference.
You are iterating over 2 vectors in parallel? Isn't that the job of zip_iterator? If you insist on using iterator_facade, my guess would be, since dereferencing creates a temporary, that iterator_facade::Reference must be explicitly Value, not Value& (the default).