std::basic_...::operator*(3)
π std::basic_...::operator*(3)
okay so this is the C++ Standard Library page for std::basic_...::operator*(3) β the header says C++ Standard Libary (iconic typo, no notes π). It's giving const iterator dereference operators and honestly it ate.
πΈ NAME
std::basic_const_iterator::operator* - std::basic_const_iterator::operator*
(yes bestie, it's listed twice, periodt.)
β¨ Synopsis
Overload (1) arrives since C++23:
constexpr std::iter_const_reference_t<Iter> operator*() const;
Overload (2) also arrives since C++23:
constexpr const auto* operator->() const
requires
std::is_lvalue_reference_v<std::iter_reference_t<Iterator>> &&
std::same_as<std::remove_cvref_t<std::iter_reference_t<Iterator>>,
value_type>;
okay so the whole vibe: it returns a reference or pointer to the const version of the current element. Highkey useful. π«Ά
- Returns
static_cast<std::iter_const_reference_t<Iter>>(*base()). - If
Itermodelscontiguous_iterator, returnsstd::to_address(base()); otherwise, returnsstd::addressof(*base()).
π Parameters
(none) β literally nobody, bestie. β¨
π Return value
- Reference-to-const that refers to the current element. The result may be a prvalue (e.g. if
*base()is a prvalue). - Pointer-to-const that points to the current element.
π¦ Example
This section is incomplete
Reason: no example π (not a single example in the group chat).
π See also
operator[]accesses an element by index (public member function)
π Category
Todo no example
xoxo bestie π
β source/version/date: http://cppreference.com, 2024.06.10, page: std::basic_...::operator*(3). Bye π«Ά
π¦ 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