std::sorted_unique_t, std::sorted_unique
來自 cppreference.com
在標頭檔案 <flat_map> 中定義 |
||
在標頭檔案 <flat_set> 中定義 |
||
struct sorted_unique_t { explicit sorted_unique_t() = default; }; |
(1) | (C++23 起) |
inline constexpr sorted_unique_t sorted_unique{}; |
(2) | (C++23 起) |
1) 型別
std::sorted_unique_t
可用於函式(包括建構函式)的引數列表,以匹配預期的標籤。2) (1) 對應的
std::sorted_unique
例項是一個消歧義標籤,可傳遞給 std::flat_map 和 std::flat_set 的函式,以指示輸入範圍或容器已排序(相對於 flat 容器介面卡中使用的比較器),並且該容器或範圍的所有元素都是唯一的。[編輯] 標準庫
以下標準庫容器介面卡使用 (1,2) 作為消歧義標籤
(C++23) |
適配兩個容器以提供鍵值對集合,按唯一鍵排序 (類模板) |
(C++23) |
適配容器以提供唯一鍵的集合,按鍵排序 (類模板) |
[編輯] 參閱
表示範圍的元素已排序(不要求唯一性) (標籤) | |
(C++23) |
來自範圍的構造標籤 (標籤) |
原地構造標籤 (標籤) |