共用方式為


unordered_multimap::allocator_type

The type of an allocator for managing storage.

typedef Alloc allocator_type;

Remarks

The type is a synonym for the template parameter Alloc.

Example

 

// std_tr1__unordered_map__unordered_multimap_allocator_type.cpp 
// compile with: /EHsc 
#include <unordered_map> 
#include <iostream> 
 
typedef std::unordered_multimap<char, int> Mymap; 
typedef std::allocator<std::pair<const char, int> > Myalloc; 
int main() 
    { 
    Mymap c1; 
 
    Mymap::allocator_type al = c1.get_allocator(); 
    std::cout << "al == std::allocator() is " 
        << std::boolalpha << (al == Myalloc()) << std::endl; 
 
    return (0); 
    } 
 
al == std::allocator() is true

Requirements

Header: <unordered_map>

Namespace: std

See Also

Reference

<unordered_map>

unordered_multimap Class