When looking up the type of std::set
's member type iterator
I was expecting a bidirectional iterator to its value_type const
. However, according to cppreference.com it has the following member types:
Member type | Definition |
---|---|
... | ... |
iterator | Constant LegacyBidirectionalIterator to value_type |
const_iterator | LegacyBidirectionalIterator to const value_type |
... | ... |
In practice both are likely to be the same type, but what is the definitional difference between these formulations?
LegacyForwardIterator (which is a base of LegacyBidirectionalIterator) seems to differentiate between LegacyForwardIterator and mutable LegacyForwardIterator implying the the former is somehow not mutable, i.e. const. However std::forward_list references also LegacyForwardIterator without mention of the word mutable:
Member type | Definition |
---|---|
iterator | LegacyForwardIterator to value_type |
Is cppreference incomplete or wrong on this account or what is going on? What is the difference between "Constant LegacyBidirectionalIterator to value_type" and "LegacyBidirectionalIterator to const value_type"?