名稱空間
變體
操作

使用多型分配器的容器的便捷別名 (庫基礎 TS)

來自 cppreference.com
 
 
實驗性
技術規範
檔案系統庫 (檔案系統 TS)
庫基礎 (庫基礎 TS)
庫基礎 2 (庫基礎 TS v2)
庫基礎 3 (庫基礎 TS v3)
並行性擴充套件 (並行性 TS)
並行性擴充套件 2 (並行性 TS v2)
併發性擴充套件 (併發性 TS)
併發擴充套件 2 (併發 TS v2)
概念 (概念 TS)
範圍 (範圍 TS)
反射 (反射 TS)
數學特殊函式 (特殊函式 TR)
實驗性非 TS
模式匹配
線性代數
std::execution
契約
2D 圖形
 
 
 

以下在 std::experimental::pmr 名稱空間中定義了使用多型分配器的容器的便捷別名和別名模板。

目錄

[編輯] 字串

別名/別名模板 別名
定義於標頭檔案 <experimental/string>
template<class CharT,
         class Traits=std::char_traits<CharT>>
using basic_string =

std::basic_string<CharT, Traits,

    polymorphic_allocator<CharT>>;

using string = pmr::basic_string<char>;
using wstring = pmr::basic_string<wchar_t>;
using u16string = pmr::basic_string<char16_t>;
using u32string = pmr::basic_string<char32_t>;

[編輯] 序列容器

別名模板 別名
定義於標頭檔案 <experimental/vector>
template<class T> using vector = std::vector<T, polymorphic_allocator<T>>;
定義於標頭檔案 <experimental/deque>
template<class T> using deque = std::deque<T, polymorphic_allocator<T>>;
定義於標頭檔案 <experimental/forward_list>
template<class T> using forward_list = std::forward_list<T, polymorphic_allocator<T>>;
定義於標頭檔案 <experimental/list>
template<class T> using list = std::list<T, polymorphic_allocator<T>>;

[編輯] 關聯容器

別名模板 別名
定義於標頭檔案 <experimental/map>
template<class Key, class T,
         class Compare=std::less<Key>>
using map =

std::map<Key, T, Compare,

    polymorphic_allocator<std::pair<const Key, T>>>;

template<class Key, class T,
         class Compare=std::less<Key>>
using multimap =

std::multimap<Key, T, Compare,

    polymorphic_allocator<std::pair<const Key, T>>>;

定義於標頭檔案 <experimental/set>
template<class Key,
         class Compare=std::less<Key>>
using set =

std::set<Key, Compare,

    polymorphic_allocator<Key>>;

template<class Key,
         class Compare=std::less<Key>>
using multiset =

std::multiset<Key, Compare,

    polymorphic_allocator<Key>>;

[編輯] 無序關聯容器

別名模板 別名
定義於標頭檔案 <experimental/unordered_map>
template<class Key, class T,
         class Hash = std::hash<Key>,
         class Pred = std::equal_to<Key>>
using unordered_map =

std::unordered_map<Key, T, Hash, Pred,

    polymorphic_allocator<std::pair<const Key, T>>>;

template<class Key, class T,
         class Hash = std::hash<Key>,
         class Pred = std::equal_to<Key>>
using unordered_multimap =

std::unordered_multimap<Key, T, Hash, Pred,

    polymorphic_allocator<std::pair<const Key, T>>>;

定義於標頭檔案 <experimental/unordered_set>
template<class Key,
         class Hash = std::hash<Key>,
         class Pred = std::equal_to<Key>>
using unordered_set =

std::unordered_set<Key, Hash, Pred,

    polymorphic_allocator<Key>>;

template<class Key,
         class Hash = std::hash<Key>,
         class Pred = std::equal_to<Key>>
using unordered_multiset =

std::unordered_multiset<Key, Hash, Pred,

    polymorphic_allocator<Key>>;

[編輯] match_results

別名/別名模板 別名
定義於標頭檔案 <experimental/regex>
template<class BidirIt>

using match_results =

std::match_results<BidirIt,

    polymorphic_allocator<std::sub_match<BidirIt>>>;

using cmatch = pmr::match_results<const char*>;
using wcmatch = pmr::match_results<const wchar_t*>;
using smatch = pmr::match_results<pmr::string::const_iterator>;
using wsmatch = pmr::match_results<pmr::wstring::const_iterator>;