When I'm using a std::unordered_map<K, V>
I know that the iterator to each key-value pair is of type std::unordered_map<K, V>::iterator
. I also know that the iterator itself points to a pair<const K, V>
. However, the only reason I know the iterator points to a pair is from looking at example code. Where is this behavior defined?
For example, if I go to the documentation at cppreference.com, I don't see where this behavior is explained. It only says that the member iterator
is defined as a ForwardIterator
.
So, my question is, how would a smart developer know what a std::unordered_map<K, V>::iterator
actually represents? I'm sure there is some logical leap I'm missing.