名前空間
変種
操作

ポリモーフィックアロケータを使用するコンテナの便利なエイリアス (ライブラリ基礎 TS)

From cppreference.com
 
 
 
 
多相アロケータライブラリ
polymorphic_allocator を使用するコンテナの便利な別名
メモリリソースクラス
グローバルメモリリソース
既存のクラスに対する型消去アロケータのサポート
 

ポリモーフィックアロケータを使用するコンテナ用の便利なエイリアスとエイリアステンプレートは、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>;
English 日本語 中文(简体) 中文(繁體)