Skip to content

Document modifying mapped values through reverse iterators - #59

Open
ac1982 wants to merge 1 commit into
Tessil:masterfrom
ac1982:docs/reverse-iterator-values
Open

ac1982 wants to merge 1 commit into
Tessil:masterfrom
ac1982:docs/reverse-iterator-values

Conversation

@ac1982

@ac1982 ac1982 commented Oct 20, 2026

Copy link
Copy Markdown

The README explains how to modify mapped values with iterator::value(), but that member is unavailable on the standard reverse-iterator adapter. Calling it.base().value() instead also refers to the wrong element and dereferences end() at rbegin().

Document std::prev(it.base()).value() beside the existing forward-iteration example, including the required <iterator> header and the one-past position of base().

Related to #43; this documents the existing API rather than adding a new reverse-iterator type.

Validation: compiled and ran the exact example with GCC 15.2 and Clang 21.1.8 under C++11, C++17 and C++20, with ASan/UBSan and strict warnings. Empty, single-element and multi-element maps pass with both deque and vector storage. The full Boost suite and other compilers were not run for this documentation-only change.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant