std::seed_seq::seed_seq
De cppreference.com
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
seed_seq();
|
(1) | (desde C++11) |
seed_seq( const seed_seq& ) = delete;
|
(2) | (desde C++11) |
template< class InputIt >
seed_seq( InputIt begin, InputIt end );
|
(3) | (desde C++11) |
template< class T >
seed_seq( std::initializer_list<T> il );
|
(4) | (desde C++11) |
1)
El constructor predeterminado crea un objeto
std::seed_seq con una secuencia inicial de la semilla de longitud cero .Original:
The default constructor creates a
std::seed_seq object with an initial seed sequence of length zero.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2)
El constructor de copia se borra:
std::seed_seq no es copiable .Original:
The copy constructor is deleted:
std::seed_seq is not copyable.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
3)
Construye un
(es decir, los 32 bits más bajos se copian)
std::seed_seq con la secuencia inicial de la semilla obtenido iterando sobre el [begin, end) rango y la copia de los valores obtenidos por eliminación de referencias el iterador, modulo 232(es decir, los 32 bits más bajos se copian)
Original:
Constructs a
(that is, the lower 32 bits are copied)
std::seed_seq with the initial seed sequence obtained by iterating over the range [begin, end) and copying the values obtained by dereferencing the iterator, modulo 232(that is, the lower 32 bits are copied)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
4)
Equivalente a
seed_seq(il.begin(), il.end()). Este constructor permite lista de inicialización .Original:
Equivalent to
seed_seq(il.begin(), il.end()). This constructor enables lista de inicialización.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Parámetros
| begin, end | - | la secuencia inicial de la semilla representa como un par de iteradores de entrada cuyo
std::iterator_traits<>::value_type es un tipo enteroOriginal: the initial seed sequence represented as a pair of input iterators whose std::iterator_traits<>::value_type is an integer typeThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| il | - | std::initializer_list de objetos de tipo entero, proporcionando la secuencia de semillas iniial
Original: std::initializer_list of objects of integer type, providing the iniial seed sequence The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| Requisitos de tipo | ||
-InputIt debe reunir los requerimientos de InputIterator.
|
Ejemplo
Ejecuta este código
#include <random>
#include <sstream>
#include <iterator>
int main()
{
std::seed_seq s1; // default-constructible
std::seed_seq s2{1, 2, 3}; // can use list-initialization
std::seed_seq s3 = {-1, 0, 1}; // another form of list-initialization
int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
std::seed_seq s4(a, a + 10); // can use iterators
std::istringstream buf("1 2 3 4 5");
std::istream_iterator<int> beg(buf), end;
std::seed_seq s5(beg, end); // even stream input iterators
}