Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: C++
Expertise: Intermediate
Oct 18, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

The Semantics of const_iterator

A recent subscriber of one of the C++ newsgroups posted the following question: Why did the C++ standardization committee created a const_iterator instead of a const iterator? Or, at least, why not require const_iterator to actually have type const iterator? The answer is simple: a const_iterator is nota const iterator. This means that you can alter the value of a const_iterator, e.g., increment it using ++. However, you cannot change the element to which a const_iterator points. In other words, if you think of an iterator as a pointer to T, a const_iterator is not a const pointer to T, but rather, it
Danny Kalev
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date