命名空间
变体
操作

使用多态分配器的容器的便捷别名 (库基础 TS)

来自 cppreference.cn
 
 
实验性
技术规范
文件系统库 (文件系统 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>;