MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / random

Function random

tests/BS_thread_pool_test.cpp:555–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553 */
554template <typename T>
555T random(const T min, const T max)
556{
557 static std::random_device rand_device;
558 static std::mt19937_64 twister(rand_device());
559 std::uniform_int_distribution<T> dist(min, max);
560 return dist(twister);
561}
562
563/**
564 * @brief Obtain an ordered pair of two distinct random numbers in a specified range.

Callers 4

check_loopFunction · 0.85
check_blocksFunction · 0.85
check_sequenceFunction · 0.85
check_vector_of_sizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected