Espacios de nombres
Variantes
Acciones

std::set::size

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

 
 
 
std::set
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.
set::set
set::~set
set::operator=
set::get_allocator
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.
set::begin
set::cbegin

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

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

(C++11)
set::rend
set::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.
set::empty
set::size
set::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.
set::clear
set::insert
set::emplace(C++11)
set::emplace_hint(C++11)
set::erase
set::swap
Buscar
Original:
Lookup
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
set::count
set::find
set::equal_range
set::lower_bound
set::upper_bound
Los observadores
Original:
Observers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
set::key_comp
set::value_comp
 
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

[editar] Ejemplo

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

#include <set>
#include <iostream>
 
int main()
{
    std::set<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]