std::flat_multimap::keys(3)
π std::flat_multimap::keys π
okay so bestie, welcome to the std::flat_multimap::keys(3) page from the C++ Standard Libary manual. yes, that's the manual name, spelling included β we respect the header. this one is a tiny little accessor and it's lowkey iconic: it hands you the keys container and minds its own business. β¨
πΈ NAME πΈ
std::flat_multimap::keys β std::flat_multimap::keys
like, that's the name. the whole name. no cap. π
π¦ Synopsis π¦
const key_container_type& keys() const noexcept; (since C++23)
you get a constant reference to the adapted keys container. it's equivalent to return c.keys;.
π Parameters π
(none) β not a single one, bestie. zero. empty. the void is serving. π«Ά
π Return value π
the underlying keys container. that's the whole return value, and honestly? it ate. π
β Complexity β
Constant. literally constant. no secret extra work hiding in the group chat. π
π Example π
// Run this code
#include <flat_map>
#include <print>
#include <type_traits>
#include <vector>
int main()
{
std::flat_multimap<int, double> adaptor{{1, 1.1}, {2, 2.2}, {3,
3.3}};
// The default keys container is std::vector:
static_assert(std::is_same_v<decltype(adaptor.keys()), const
std::vector<int>&>);
std::println("{}", adaptor.keys());
}
Output:
[1, 2, 3]
π See also π
valuesβ direct access to the underlying values container (public member function)
okay that's the whole page, bestie. source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::flat_multimap::keys(3) β mwah, go access those keys 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