std::flat_multimap::begin,(3)
πΈ std::flat_multimap::begin,(3) πΈ
hey bestie π welcome to the std::flat_multimap::begin,(3) page from the C++ Standard Libary manual β yes, that exact spelling, sheβs serving typo realness and we respect it.
NAME π
std::flat_multimap::begin, β okay so the name is std::flat_multimap::begin,, and the page literally lists it again as std::flat_multimap::begin, after a -. The comma is part of the name. Do not come for her. π
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)
Returns an iterator to the first element of the flat_multimap. β¨
If the flat_multimap is empty, the returned iterator will be equal to end(). no cap, thatβs the vibe check.
Also range-begin-end.svg is literally just hanging out in this page. Itβs a diagram, sheβs iconic, we move. π«Ά
Parameters πΈ
(none) β not a single parameter, bestie. not one. π
Return value π
Iterator to the first element. Thatβs the whole tea. π
Complexity β
Constant. periodt.
Example π
// Run this code
#include <iostream>
#include <flat_map>
int main()
{
std::flat_multimap<int, int> map{{4, 13}, {9, 94}, {1, 19}, {4, 42}};
for (auto it = map.cbegin(); it != map.cend(); ++it)
std::cout << '[' << it->first << "] = " << it->second << '\n';
// Unlike std::multimap's bidirectional iterators, the std::flat_multimap
// iterators are random-access, so they can be used with the operator[]:
auto it = map.cbegin();
assert(it[1] == 19);
assert(it[4] == 13);
assert(it[4] == 42);
assert(it[9] == 94);
}
Output: π₯
[1] = 19
[4] = 13
[4] = 42
[9] = 94
See also π
endβ returns an iterator to the endcendβ (public member function)beginβ returns an iterator to the beginning of a container or array; tagged(C++11),(function template)cbeginβ returns an iterator to the beginning of a container or array; tagged(C++14)
okay bye bestie π this page comes from http://cppreference.com, dated 2024.06.10, and the footer says std::flat_multimap::begin,(3) one more time for the people in the back. 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