- flat_map[meta header]
- std[meta namespace]
- class template[meta id-type]
- cpp23[meta cpp]
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>> { };
}
- bool_constant[link /reference/type_traits/bool_constant.md]
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;
}
- std::uses_allocator[color ff0000]
- std::allocator[link /reference/memory/allocator.md]
1
- C++23
- Clang: ??
- GCC: ??
- Visual C++: ??