public member function
<random>
std::independent_bits_engine::(constructor) (1)independent_bits_engine();(2)
explicit independent_bits_engine (const Engine& e);(3)
explicit independent_bits_engine (Engine&& e);(4)
explicit independent_bits_engine (result_type val);(5)
template <class Sseq>explicit independent_bits_engine (Sseq& q);
Construct independent-bits engine
Constructs an independent_bits_engine object, by initializing its internal base engine to e or to an engine constructed with argument val or q (or default-constructed).1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// independent_bits_engine constructor
#include <iostream>
#include <chrono>
#include <cstdint>
#include <random>
int main ()
{
typedef std::independent_bits_engine<std::mt19937,64,std::uint_fast64_t> generator_type;
generator_type g1;
generator_type g2(g1.base());
std::mt19937 temp;
generator_type g3(std::move(temp));
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
generator_type g4(seed);
std::seed_seq sseq ({2,16,77});
generator_type g5(sseq);
std::cout << "g1(): " << g1() << std::endl;
std::cout << "g2(): " << g2() << std::endl;
std::cout << "g3(): " << g3() << std::endl;
std::cout << "g4(): " << g4() << std::endl;
std::cout << "g5(): " << g5() << std::endl;
return 0;
}
g1(): 15028999435905310454 g2(): 15028999435905310454 g3(): 15028999435905310454 g4(): 10430347962942516627 g5(): 10290956923231226317
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4