std::flat_multimap<Key,T,Compare,KeyContainer,MappedContainer>::values
來自 cppreference.com
< cpp | 容器 | flat_multimap
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]
[編輯] 參閱
直接訪問底層鍵容器 (public member function) |