std::flat_map::values(3)

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

πŸ’… std::flat_map::values(3) πŸ’…

✨ NAME ✨

std::flat_map::values - std::flat_map::values β€” yes bestie, the NAME line is literally the same thing twice, and we’re not mad about it. This is the C++ Standard Libary page for the std::flat_map::values member function. πŸ‘‘

πŸ¦‹ Synopsis πŸ¦‹

The whole signature, fresh off the compiler:

const mapped_container_type& values() const noexcept;  (since C++23)

Return a constant reference to the adapted values container. Equivalent to return c.values;. No cap. πŸ’…

πŸŽ€ Parameters πŸŽ€

(none) β€” zero parameters. Not a single one. Nada. 🫢

🌸 Return value 🌸

The underlying values container. That’s the tea. πŸ“

πŸ”₯ Complexity πŸ”₯

Constant. Periodt. ⚑

πŸ’– Example πŸ’–

Run this code, bestie:

// Run this code

#include <flat_map>
#include <print>
#include <type_traits>
#include <vector>

int main()
{
    std::flat_map<int, double> map{{1, 1.1}, {2, 2.2}, {3, 3.3}};

    // The default values container is std::vector:
    static_assert(std::is_same_v<decltype(map.values()), const
       std::vector<int>&>);

    std::println("{}", map.values());
}

🌈 Output 🌈

[1.1, 2.2, 3.3]

πŸ‘€ See also πŸ‘€

  • keys β€” direct access to the underlying keys container (public member function).

xoxo bestie πŸ’– this was the std::flat_map::values(3) page from http://cppreference.com, version/date 2024.06.10. Slay. πŸ¦‹

πŸ“¦ where this page comes from