
please wait
|
|
C.begin() returns a const_iterator since set is const |
|
|
For associative containers where the value type is the same as the key type, both iterator and const_iterator are constant iterators. It is unspecified whether or not iterator and const_iterator are the same type. [Note 2: iterator and const_iterator have identical semantics in this case, and iterator is convertible to const_iterator. Users can avoid violating the one-definition rule by always using const_iterator in their function parameter lists. — end note] https://eel.is/c++draft/container.requirements#associative.reqmts.general-6 |