unordered_set::get_allocator
Gets the stored allocator object.
Alloc get_allocator() const;
설명
The member function returns the stored allocator object.
예제
// std_tr1__unordered_set__unordered_set_get_allocator.cpp
// compile with: /EHsc
#include <unordered_set>
#include <iostream>
typedef std::unordered_set<char> Myset;
typedef std::allocator<std::pair<const char, int> > Myalloc;
int main()
{
Myset c1;
Myset::allocator_type al = c1.get_allocator();
std::cout << "al == std::allocator() is "
<< std::boolalpha << (al == Myalloc()) << std::endl;
return (0);
}
요구 사항
헤더: <unordered_set>
네임스페이스: std