| Technical Specification | ||||
| Filesystem library(filesystem TS) | ||||
| Library fundamentals(library fundamentals TS) | ||||
| Library fundamentals 2(library fundamentals TS v2) | ||||
| Library fundamentals 3(library fundamentals TS v3) | ||||
| Extensions for parallelism(parallelism TS) | ||||
| Extensions for parallelism 2(parallelism TS v2) | ||||
| Extensions for concurrency(concurrency TS) | ||||
| Extensions for concurrency 2(concurrency TS v2) | ||||
| Concepts(concepts TS) | ||||
| Ranges(ranges TS) | ||||
| Reflection(reflection TS) | ||||
| Mathematical special functions(special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
Defined in header <experimental/random> | ||
void reseed(); | (1) | (library fundamentals TS v2) |
void reseed( std::default_random_engine::result_type value); | (2) | (library fundamentals TS v2) |
Reseeds theper-thread random number engine and anystd::uniform_int_distribution instances used byrandint.
g as if byg.seed(value).Contents |
| value | - | value of the new seed |
Subsequent calls torandint do not depend on values produced by the per-thread engine prior to callingreseed.
#include <experimental/random>#include <iostream> int main(){ std::experimental::reseed(); std::cout<<"Random 2-digit decimal numbers: "; for(auto i=0; i!=3;++i)std::cout<<std::experimental::randint(10,99)<<' ';std::cout<<'\n';}
Possible output:
Random 2-digit decimal numbers: 41 60 56
| generates a random integer in the specified range (function template)[edit] |