Difference between STL list iterators C++11 -


this question has answer here:

well, see c++11, there 4 new functions in list (stl) return iterators, cbegin, cend, crbegin, crend. reading @ cplusplus (webpage), saw return const iterators of 4 kinds(beginning, end, reverse beginning , reverse end iterators), question is:

the functions existed before c++11 returned const iterators if list const-qualified (i'm talking begin, end, rbegin , rend), difference of these const iterators , returned new c++11 functions? or @ least, point of making 4 news functions when had 4 returned same const iterators?

thanks , sorry english.

cbegin always returns const_iterator.

begin return const_iterator if call on const container, have mutable container, , reason want const_iterator. before, had call begin, , explicitly cast iterator returned const_iterator.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -