std::flat_multiset::begin,(3)
π
std::flat_multiset::begin,(3) π
okay bestie, welcome to this C++ Standard Libary manual page for std::flat_multiset::begin, β yes, the manual name has that exact spelling, and yes, the NAME has that little comma. we are keeping every single crumb. π
π NAME π
std::flat_multiset::begin,-std::flat_multiset::begin,
β¨ Synopsis β¨
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)
so what does it do? it Returns an iterator to the first element of the flat_multiset. slay.
if the flat_multiset is empty, the returned iterator will be equal to end(). important vibe check β¨
there's also a diagram file called range-begin-end.svg doing its little range-begin-end thing in the background.
πΈ Parameters πΈ
(none) β no args, no stress, no drama.
π Return value π
Iterator to the first element. periodt.
π¦ Complexity π¦
Constant. absolutely no extra effort, iconic behavior.
π Notes π
ngl, this is the important bit, bestie: 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. so don't try to be sneaky with it π
π Example π
the page says // Run this code before the snippet:
#include <algorithm>
#include <flat_set>
#include <iostream>
int main()
{
std::flat_multiset<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 1 2 3 4 5 5 6 9
π See also π
the SEE ALSO section is giving chaotic group-chat energy, but every line is here:
endβ returns an iterator to the endcendβ (public member function)begincbeginβ returns an iterator to the beginning of a container or array(C++11)(function template)(C++14)
mwah π this page came from http://cppreference.com, dated 2024.06.10, and it's the std::flat_multiset::begin,(3) page. byeee, go iterate responsibly π«Ά
π¦ 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