std::basic_...::operator[](3)
std::basic_...::operator[](3) π
okay bestie, welcome to the C++ Standard Libary manual page β yes, Libary is spelled like that in the source, and we are not fixing it, we are respecting the lore. The title on deck is std::basic_...::operator[](3), and this whole page is about the std::basic_const_iterator::operator[] vibe. π«Ά
NAME β¨
The NAME block is literally std::basic_const_iterator::operator[] - followed by std::basic_const_iterator::operator[]. Yes, it's the same name twice with a dash moment. iconic behavior. π
Synopsis πΈ
constexpr std::iter_const_reference_t<Iter> operator[](
difference_type n ) const
This one is (since C++23), and it requires std::random_access_iterator<Iterator>;.
It returns a reference to the element at specified relative location. no cap, that's the whole synopsis.
Parameters π
nβ position relative to current location.
Return value π
A reference-to-const to the element at relative location, and the exact expression is static_cast<std::iter_const_reference_t<Iter>>(base()[n]).
Example π
This section is incomplete.
Reason: no example.
bestie they really left us hanging with no example. it's giving "trust me, the signature is the example." π
See also π₯
operator*β accesses the pointed-to element.operator->β public member function.
Category: π
* Todo no example
xoxo, signing off with source http://cppreference.com, version/date 2024.06.10, and the footer title std::basic_...::operator[](3) β stay random-access, bestie π¦π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms