std::revers...rse_iterator(3)

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

πŸ’… NAME πŸ’…

std::revers...rse_iterator::reverse_iterator β€” okay bestie, this is the constructor page, and the NAME is literally std::reverse_iterator::reverse_iterator. This page is from the C++ Standard Libary manual (spelling exactly as the manual says, not me 🫢), and the whole page header vibe is std::revers...rse_iterator(3).


✨ Synopsis ✨

Constructs a new iterator adaptor. The synopsis tokens are all here, un-mangled from the original line-wrap chaos:

reverse_iterator();                              (until C++17)
constexpr reverse_iterator();                    (since C++17)
explicit reverse_iterator( iterator_type x );    (until C++17)
constexpr explicit reverse_iterator( iterator_type x ); (since C++17) (1)
template< class U >
reverse_iterator( const reverse_iterator<U>& other ); (until C++17) (2)
template< class U >
constexpr reverse_iterator( const reverse_iterator<U>& other ); (since C++17) (3)
  1. Default constructor. The underlying iterator is value-initialized. Operations on the resulting iterator have defined behavior if and only if the corresponding operations on a value-initialized Iter also have defined behavior.
  2. The underlying iterator is initialized with x.
  3. The underlying iterator is initialized with that of other. This overload participates in overload resolution only if U is not the same type as Iter and std::convertible_to<const U&, Iter> is modeled (since C++20).

πŸŽ€ Parameters πŸŽ€

  • x β€” iterator to adapt
  • other β€” iterator adaptor to copy

🌸 Example 🌸

Okay so the Example section is not giving, bestie. It says, word for word:

This section is incomplete Reason: no example

😭 No example. None. Zero. The example section is literally on a break.


πŸ¦‹ Defect reports πŸ¦‹

The following behavior-changing defect reports were applied retroactively to previously published C++ standards:

  • LWG 235 β€” Applied to: C++98; Behavior as published: the effect of the default constructor was not specified; Correct behavior: specified.
  • LWG 1012 β€” Applied to: C++98; Behavior as published: the underlying iterator was default-initialized; Correct behavior: it is value-initialized.
  • LWG 3435 β€” Applied to: C++20; Behavior as published: the converting constructor from another reverse_iterator was not constrained; Correct behavior: constrained.

πŸ‘€ See also πŸ‘€

  • operator= β€” assigns another iterator adaptor (public member function)
  • make_reverse_iterator (C++14) β€” creates a std::reverse_iterator of type inferred from the argument (function template)

🏷️ Category 🏷️

  • Todo no example

That’s the whole page, bestie πŸ’– The cute little source/version/date sign-off at the very end is: http://cppreference.com, 2024.06.10, std::revers...rse_iterator(3). Slay, bye βœ¨πŸ’…

πŸ“¦ where this page comes from