cppreference-doc icon indicating copy to clipboard operation
cppreference-doc copied to clipboard

Not sure: : should forward_iterator_tag not also inherit from truct output_iterator_tag ?

Open F-Haferkorn opened this issue 2 years ago • 1 comments

Hello at all, reading https://en.cppreference.com/w/cpp/iterator/iterator_tags, i wonder, the inheritance structure of should forward_iterator_tag is correct herein.

Is the forward_iterator_tag not also inherit from sruct output_iterator_tag ?

it says struct forward_iterator_tag : public input_iterator_tag {}; // (4)

Were do I find a decise manual howto properly write my own iterators for my own classes. Yours, Frank.Haferkorn

F-Haferkorn avatar Jan 09 '24 20:01 F-Haferkorn

Not every forward iterator is writable, so no it should not.

PeterFeicht avatar Nov 10 '24 16:11 PeterFeicht