std::array::size

Da cppreference.com.
< cpp‎ | container‎ | array

 
 
 
std::array
Membri funzioni
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Elemento accesso
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::at
array::operator[]
array::front
array::back
array::data
Iteratori
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::begin
array::cbegin
array::end
array::cend
array::rbegin
array::crbegin
array::rend
array::crend
Capacità
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::empty
array::size
array::max_size
Modificatori
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::fill
array::swap
Non membri funzioni
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
get
swap
Helper classi
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tuple_size
tuple_element
 
constexpr size_type size()
(dal C++11)

Returns the number of elements in the container, i.e. std::distance(begin(), end()).

Indice

[modifica]Parametri

(Nessuno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Valore di ritorno

il numero di elementi nel contenitore
Original:
the number of elements in the container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Eccezioni

noexcept specification:  
noexcept
  (dal C++11)

[modifica]Complessità

Constant

[modifica]Esempio

The following code uses size to display the number of elements in a std::array<int>:

#include <array>#include <iostream>   int main(){std::array<int> nums {1, 3, 5, 7};   std::cout<<"nums contains "<< nums.size()<<" elements.\n";}

Output:

nums contains 4 elements.

[modifica]Vedi anche

verifica se il contenitore è vuoto
Original:
checks whether the container is empty
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico)[modifica]
restituisce il massimo numero possibile di elementi
Original:
returns the maximum possible number of elements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(metodo pubblico)[modifica]
close