From: Sean P. <sp...@ad...> - 2005-12-12 23:25:12
|
On Dec 12, 2005, at 2:42 PM, Thomas Witt wrote: > > Hi, > > any_iterator equal is currently implemented as follows > > iterator.hpp:242 > > bool equal(const any_iterator& x) const > { > return (type() == x.type()) && object_m->equal(*x.object_m); > } > > IIUC the type equality check is unneeded and may hide bugs. > > Type equality is given implicitly by the requirement that both > iterators point into the same sequence. As a sidenote AFAICS > any_iterators do not support interoperable iterators, eg. > vector<int>::iterator/vector<int>::const_iterator but the equal > implementations would yield false for these even if they point to > the same position in a sequence. > > What did I miss Hi Thomas - I don't think you missed anything. This is a good point about the type () equality being implicitly required - I will replace the check with an assert. "interoperable" iterators (iterators with different underlying types pointing to the same structure) was not a design goal. Sean > > Thomas > > -- > Thomas Witt > wi...@ac... > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Adobe-source-devel mailing list > Ado...@li... > https://lists.sourceforge.net/lists/listinfo/adobe-source-devel |