std::ranges...rator::base(3)
okay so bestie, pull up a seat π«Ά β this is std::ranges...rator::base(3) from the C++ Standard Library manual, and weβre about to make iterator internals make sense π
β¨
π NAME π
std::ranges::elements_view::iterator::base β std::ranges::elements_view::iterator::base
πΈ Synopsis πΈ
okay so there are two overloads, both iconic, both since C++20:
(1) (since C++20)
constexpr const ranges::iterator_t<Base>& base() const & noexcept;
(2) (since C++20)
constexpr ranges::iterator_t<Base> base() &&;
Returns the underlying iterator. underlying iterator is the main character here, fr fr π
1)Returns a reference to the underlying iterator.2)Move constructs the result from the underlying iterator.
β¨ Parameters β¨
(none) β literally no parameters, sheβs low-maintenance π
π Return value π
1)A reference to the underlying iterator.1)An iterator move constructed from the underlying iterator. (yes bestie, the page labels both of them1)β iconic typo energy, but thatβs what it says π)
π¦ Example π¦
This section is incomplete
Reason: no example
no cap, there is literally no example here π
π₯ Defect reports π₯
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
- DR:
LWG 3533β Applied to:C++20β Behavior as published: theconst&overload ofbasereturns a copy of the underlying iterator β Correct behavior: returns a reference. - DR:
LWG 3593β Applied to:C++20β Behavior as published: theconst&overload ofbasemight not benoexceptβ Correct behavior: madenoexcept.
π Category π
Category: * Todo no example
mwah π thatβs the std::ranges...rator::base(3) tea β source: http://cppreference.com, version/date: 2024.06.10 πΈπ
π¦ 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