std::output_iterator(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so welcome to the std::output_iterator(3) page, straight from the C++ Standard Libary manual β€” yes, that's the manual name folded in near the top, and it's giving OG header energy. The star of the show is std::output_iterator β€” literally std::output_iterator, no cap πŸŽ€


πŸ“œ Synopsis πŸ“œ

Defined in header <iterator> bestie:

template< class I, class T >

    concept output_iterator =
        std::input_or_output_iterator<I> &&
        std::indirectly_writable<I, T> &&
(since C++20)
        requires(I i, T&& t) {
            *i++ = std::forward<T>(t); /* not required to be
equality-preserving */

        };

So the output_iterator concept is a refinement of input_or_output_iterator, adding the requirement that it can be used to write values of type and value category encoded by T (via indirectly_writable). equality_comparable is not required. Not me checking for equality, because we literally don't need it πŸ’…


πŸ¦‹ Notes πŸ¦‹

Unlike the LegacyOutputIterator requirements, the output_iterator concept does not require that the iterator category tag be defined. No cap.

Algorithms on output iterators should be single pass. Literally one pass, bestie β€” don't make it weird 🫢


πŸ‘€ See also πŸ‘€

  • input_or_output_iterator β€” specifies that objects of a type can be incremented and dereferenced (C++20) (concept).

source/version/date check, bestie: http://cppreference.com Β· version/date 2024.06.10 Β· page std::output_iterator(3). mwah, periodt πŸ’‹βœ¨

πŸ“¦ where this page comes from