• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    class template
    <flat_map>

    std::uses_allocator

    namespace std {
      template <class Key, class T, class Compare, class KeyContainer, class MappedContainer,
                class Alloc>
      struct uses_allocator<flat_multimap<Key, T, Compare, KeyContainer, MappedContainer>,
                            Alloc>
        : bool_constant<uses_allocator_v<KeyContainer, Alloc> &&
                        uses_allocator_v<MappedContainer, Alloc>> { };
    }
    

    概要

    uses_allocatorの、flat_multimapに対する特殊化。

    アロケータを指定するflat_multimapコンストラクタにおいて、指定されたアロケータと、KeyContainerおよびMappedContainerのアロケータが合致するかをチェックするのに使われる。

    #include <flat_map>
    #include <iostream>
    
    int main()
    {
      using fm_t = std::flat_multimap<int, int>;
    
      std::cout << std::uses_allocator<fm_t, std::allocator<int>>::value << std::endl;
    }
    

    出力

    1
    

    バージョン

    言語

    • C++23

    処理系

    参照