std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer>::values
const mapped_container_type& values() const noexcept; | (начиная с C++23) |
Возвращает константную ссылку на адаптированный контейнер значений. Эквивалентно return c.values;.
Параметры
(нет)
Возвращаемое значение
Базовый контейнер значений.
Сложность
Постоянная.
Пример
#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());
}
Вывод:
[1.1, 2.2, 3.3]
См. также
| прямой доступ к базовому контейнеру ключей (открытая функция-член) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/container/flat_multimap/values