std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>::values
From cppreference.com
| 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_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()); }
出力
[1.1, 2.2, 3.3]
[編集] 関連項目
| 基底キーコンテナへの直接アクセス (public member function) |