userver: userver/utils/rand.hpp File Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
rand.hpp File Reference

Random number generators. More...

#include <cstdint>
#include <random>
#include <userver/utils/assert.hpp>
+ Include dependency graph for rand.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  utils::RandomBase
 Virtualized standard UniformRandomBitGenerator concept, for use with random number distributions. More...
 

Namespaces

namespace  utils
 Utilities.
 

Functions

RandomBaseutils::DefaultRandom ()
 Returns a thread-local UniformRandomBitGenerator.
 
template<typename T >
utils::RandRange (T from_inclusive, T to_exclusive)
 Generates a random number in range [from, to)
 
template<typename T >
utils::RandRange (T to_exclusive)
 Generates a random number in range [0, to)
 
uint32_t utils::Rand ()
 Generate a random number in the whole uint32_t range.
 

Detailed Description

Random number generators.

Definition in file rand.hpp.