Udostępnij za pośrednictwem


vector::max_size

Zwraca maksymalną długość wektora.

size_type max_size( ) const;

Wartość zwracana

Maksymalna długość możliwe wektora.

Przykład

// vector_max_size.cpp
// compile with: /EHsc
#include <vector>
#include <iostream>

int main( )
{
   using namespace std;   
   vector <int> v1;
   vector <int>::size_type i;

   i = v1.max_size( );   
   cout << "The maximum possible length of the vector is " << i << "." << endl;
}

Przykładowe dane wyjściowe

The maximum possible length of the vector is 1073741823.

Wymagania

Nagłówek: <vector>

Obszar nazw: std

Zobacz też

Informacje

vector Class

Standardowa biblioteka szablonu