Skip to main content

fixstr::basic_fixed_string::rbegin
fixstr::basic_fixed_string::crbegin

1#
[[nodiscard]] constexpr reverse_iterator rbegin() noexcept;
2#
[[nodiscard]] constexpr const_reverse_iterator rbegin() const noexcept;
3#
[[nodiscard]] constexpr const_reverse_iterator crbegin() const noexcept;

Returns a reverse iterator to the first character of the reversed fixed string. It corresponds to the last character of the non-reversed fixed string.

Image explaining reverse iterators

Parameters#

(none)

Return value#

Reverse iterator to the first character.

Complexity#

Constant.

Example#

#include <algorithm>#include <fixed_string.hpp>#include <iostream>#include <iterator>#include <string>
int main(){    fixstr::fixed_string s("Exemplar!");    *s.rbegin() = 'y';    std::cout << s << '\n'; // "Exemplary"
    std::string c;    std::copy(s.crbegin(), s.crend(), std::back_inserter(c));    std::cout << c << '\n'; // "yralpmexE"}
Output:
ExemplaryyralpmexE