diff --git a/random.hpp b/random.hpp index 68e66943..8e4e197d 100644 --- a/random.hpp +++ b/random.hpp @@ -189,6 +189,21 @@ namespace cruft::random { } + ///------------------------------------------------------------------------ + /// Return a uniformly random chosen value over integral values in the type + template + requires (std::is_integral_v and UniformRandomBitGenerator>) + T + uniform (GeneratorT &&gen) + { + return uniform ( + std::numeric_limits::min (), + std::numeric_limits::max (), + std::forward (gen) + ); + } + + ///------------------------------------------------------------------------ /// Returns a uniformly random initialised coordinate type by value. template <