std::flat_multimap::keys(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– 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