Espacios de nombres
Variantes
Acciones

std::list::size

De cppreference.com
< cpp‎ | container‎ | list

 
 
 
std::list
Las funciones miembro
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.
list::list
list::~list
list::operator=
list::assign
list::get_allocator
Elemento acceso
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.
list::front
list::back
Los iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
list::begin
list::cbegin

(C++11)
list::end
list::cend

(C++11)
list::rbegin
list::crbegin

(C++11)
list::rend
list::crend

(C++11)
Capacidad
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
list::empty
list::size
list::max_size
Modificadores
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
list::clear
list::insert
list::emplace(C++11)
list::erase
list::push_front
list::emplace_front(C++11)
list::pop_front
list::push_back
list::emplace_back(C++11)
list::pop_back
list::resize
list::swap
Operaciones
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
list::merge
list::splice
list::remove
list::remove_if
list::reverse
list::unique
list::sort
 
size_type size() const;

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

Contenido

[editar] Parámetros

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

[editar] Valor de retorno

el número de elementos en el contenedor
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.

[editar] Excepciones

noexcept specification:  
noexcept
  (desde C++11)

[editar] Complejidad

Constant or linear (hasta C++11)

Constant (desde C++11)

[editar] Ejemplo

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

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

Output:

nums contains 4 elements.

[editar] Ver también

comprueba si el recipiente está vacía
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.

(miembro público función) [edit]
devuelve el número máximo posible de elementos
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.

(miembro público función) [edit]
changes the number of elements stored
(miembro público función) [edit]