std::flat_map::values(3)
π 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
- 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