C++ named requirements: LegacyIterator

The LegacyIterator requirements describe types that can be used to identify and traverse the elements of a container.

# Declarations

template<class I>
concept __LegacyIterator =
requires(I i)
{
{ *i } -> __Referenceable;
{ ++i } -> std::same_as<I&>;
{ *i++ } -> __Referenceable;
} && std::copyable<I>;

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 2437C++98*r is required to be referencenot required for output iterators
LWG 3420C++20the exposition-only concept checks copyable firstcopyable is checked only if the requires-expression yields true

# See also