public member function
<random>
std::shuffle_order_engine::shuffle_order_engine (1)shuffle_order_engine();(2)
explicit shuffle_order_engine (const Engine& e);(3)
explicit shuffle_order_engine (Engine&& e);(4)
explicit shuffle_order_engine (result_type val);(5)
template <class Sseq>explicit shuffle_order_engine (Sseq& q);
Construct shuffle-order engine
Constructs a shuffle_order_engine object, by initializing its internal base engine to e or to an engine constructed with argument val or q (or default-constructed).The internal buffer table is filled with values returned by its base engine.
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
// shuffle_order_engine constructor
#include <iostream>
#include <chrono>
#include <random>
int main ()
{
// knuth_b is a standard shuffle_order_engine type:
std::knuth_b g1;
std::knuth_b g2(g1.base());
std::minstd_rand0 temp;
std::knuth_b g3(std::move(temp));
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::knuth_b g4(seed);
std::seed_seq sseq ({2,16,77});
std::knuth_b 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(): 152607844 g2(): 118710299 g3(): 152607844 g4(): 720383482 g5(): 559199553
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