std::flat_multiset::end,(3)
π std::flat_multiset::end,(3) π
okay bestie, welcome to the C++ Standard Libary page for std::flat_multiset::end β yes, thatβs the manual name folded in right here at the top so we can get into the cute stuff. π
β¨ NAME β¨
std::flat_multiset::end, - std::flat_multiset::end, π
πΈ Synopsis πΈ
three flavors, all noexcept, all since C++23:
iterator end() noexcept; (1) (since C++23)
const_iterator end() const noexcept; (2) (since C++23)
const_iterator cend() const noexcept; (3) (since C++23)
so basically end() gives you an iterator to the element following the last element of the flat_multiset. that element is a placeholder β not me being dramatic β and attempting to access it results in undefined behavior. π
thereβs also a little diagram file in the original: range-begin-end.svg π¦
π Parameters π
(none) β literally zero parameters, she takes nothing. β¨
π Return value π
Iterator to the element following the last element. π«Ά
β Complexity β
Constant. π
π§ 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 cap. π₯
π Example π
// Run this code
#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 π
beginβ returns an iterator to the beginningcbeginβ (public member function)endcendβ returns an iterator to the end of a container or array(C++11)β (function template)(C++14)
okay thatβs the whole page, bestie π«Ά β source/version vibes from http://cppreference.com, dated 2024.06.10, title std::flat_multiset::end,(3), manual C++ Standard Libary. 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