Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Questions about "mismatch"
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="gwowen, post: 4169613"] It's only an *iterator* comparison, which isn't necessarily the same thing. Your library caches indices by design, so this iterator comparison is always cheap -- so every iterator is a potential random- access-iterator. But, you have to pay the price of invalidating all iterators even for structures where it is not absolutely necessary (deletion from a linked list or a map, say). It's a trade-off. Personally, I'd've liked defined behaviour for those containers where the check can be shown to be cheap (e.g. anything for which std::distance is O(1)), and undefined for everything else, but I can see why such asymmetry was not thought good by the standard writers. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Questions about "mismatch"
Top