std::flat_set::begin,(3)
πΈ NAME πΈ
Okay so youβre on the std::flat_set::begin,(3) page from the C++ Standard Libary β and yes, the header spells it βLibaryβ like that, iconic typo behavior π
. The NAME is std::flat_set::begin, β and the original NAME line also repeats std::flat_set::begin, after the dash, fr fr.
β¨ Synopsis β¨
Three signatures, all since C++23, and here they are exactly:
iterator begin() noexcept; (1) (since C++23)
const_iterator begin() const noexcept; (2) (since C++23)
const_iterator cbegin() const noexcept; (3) (since C++23)
Returns an iterator to the first element of the flat_set.
If the flat_set is empty, the returned iterator will be equal to end().
Thereβs also a diagram vibe referenced as range-begin-end.svg.
π Parameters π
(none) β literally no parameters, bestie.
π«Ά Return value π«Ά
Iterator to the first element.
π Complexity π
Constant. Thatβs the whole mood.
π Notes π
Because both iterator and const_iterator are constant iterators (and may in fact be the same type), it is not possible to mutate the elements of the container through an iterator returned by any of these member functions. No sneaky edits through these iterators, periodt. π«
π Example π
// Run this code
#include <algorithm>
#include <flat_set>
#include <iostream>
int main()
{
std::flat_set<int> set{3, 1, 4, 1, 5, 9, 2, 6, 5};
std::for_each(set.cbegin(), set.cend(), [](int x)
{
std::cout << x << ' ';
});
std::cout << '\n';
}
π Output: π
1 2 3 4 5 6 9
π¦ See also π¦
endβ returns an iterator to the endcendβ (public member function)begincbeginβ returns an iterator to the beginning of a container or array(C++11)(C++14)(function template)
Source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::flat_set::begin,(3) β mwah π
π¦ 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