Namespaces
Variants
Actions

std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer>::values

From cppreference.com
 
C++
 
Containers library
 
std::flat_multimap
const mapped_container_type& values() const noexcept;
(since C++23)

Return a constant reference to the adapted values container. Equivalent to return c.values;.

Contents

[edit] Parameters

(none)

[edit] Return value

The underlying values container.

[edit] Complexity

Constant.

[edit] Example

#include <flat_map>
#include <print>
#include <type_traits>
#include <vector>
 
int main()
{
    std::flat_multimap<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]

[edit] See also

direct access to the underlying keys container
(public member function) [edit]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant