By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,260 Members | 1,415 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,260 IT Pros & Developers. It's quick & easy.

comparing iterator with const_iterator

P: n/a
For STL Containers, is it well-defined what happens when comparing (for
equality) an iterator and a const_iterator which "point" to the same
container element?
Jun 14 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Mark P wrote:
For STL Containers, is it well-defined what happens when comparing
(for equality) an iterator and a const_iterator which "point" to the
same container element?


Yes, they should compare equal. An object of type 'iterator' is
convertible to an object of type 'const_iterator' for all containers.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 14 '06 #2

P: n/a
Mark P wrote:
For STL Containers, is it well-defined what happens when comparing
(for equality) an iterator and a const_iterator which "point" to the
same container element?


Yes, the two iterators must compare equal.

Bart v Ingen Schenau
--
a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq
c.l.c FAQ: http://www.eskimo.com/~scs/C-faq/top.html
c.l.c++ FAQ: http://www.parashift.com/c++-faq-lite/
Jun 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.