allocator::size_type
Visual Studio 2012
An unsigned integral type that can represent the length of any sequence that an object of template class allocator can allocate.
typedef size_t size_type;
// allocator_size_type.cpp
// compile with: /EHsc
#include <memory>
#include <iostream>
#include <vector>
using namespace std;
int main( )
{
vector <double> v;
vector <double> ::iterator vIter;
vector <double> :: allocator_type vAlloc;
int j;
for ( j = 1 ; j <= 7 ; j++ )
{
v.push_back( 100.0 * j );
}
cout << "The original vector v is:\n ( " ;
for ( vIter = v.begin( ) ; vIter != v.end( ) ; vIter++ )
cout << *vIter << " ";
cout << ")." << endl;
allocator<double>::size_type vsize;
vsize = vAlloc.max_size( );
cout << "The number of doubles that can be allocated before\n"
<< " the free memory in the vector v is used up is: "
<< vsize << "." << endl;
}