
Hi all, I am trying to disguise a std container non-const iterator as a const_iterator. My guess is that iterator_adaptor could be useful for
"Martin Wartens" <martin.wartens@my-mail.ch> wrote in message news:380-2200411230224347494@my-mail.ch... this,
but I can't figure it out myself.
I am trying to solve an old problem with the standard library, which is that you can't convert a const_iterator into an iterator. [There are two "solutions" to that problem, one uses distance and is expensive, the other one does a brutal conversion on bitlevel which breaks for several std implementations.]
A third solution?: (untested) const_iterator_type wrapper::erase( const_iterator_type aItr ) { thismaptype::iterator lItr = thismap.find( aItr->first ); if( lItr == thismap.end() ) throw something; return thismap.erase( lItr ); } Jeff Flinn