c++ Pseudo-random generator wrapper
You might be able to save the overhead of constructing a new generator on each call, with something like:

static std::mt19937 default_generator(std::random_device{}());

static int getInt(int min, int max)
{
    return std::uniform_int_distribution{min, max}(default_generator);
}


But, given that most uses require several values from a single distribution and there's rarely a need to use more than one generator, is this header really worth its cognitive load?  Each function is a one-liner, and even less if the distribution can be re-used over several calls.

We'd also expect to have versions for longer or unsigned integer types, and for double and other floating-point types.  It probably makes more sense for it to be a template:

#include &lt;random&gt;
#include &lt;type_traits&gt;

template&lt;typename T&gt;
inline T getUniformRandom(T min, T max)
{
    static std::mt19937 default_generator(std::random_device{}());
    if constexpr (std::is_integral_v&lt;T&gt;) {
        return std::uniform_int_distribution{min, max}(default_generator);
    } else if constexpr (std::is_floating_point_v&lt;T&gt;) {
        return std::uniform_real_distribution{min, max}(default_generator);
    }

    static_assert(0, "getUniformRandom requires an arithmetic type");
    return min+max;             // just to eliminate compiler warnings
}


Alternatively, use std::enable_if instead of if constexpr:

#include &lt;random&gt;
#include &lt;type_traits&gt;

template&lt;typename T&gt;
inline std::enable_if_t&lt;std::is_integral_v&lt;T&gt;, T&gt; getUniformRandom(T min, T max)
{
    static std::mt19937 default_generator(std::random_device{}());
    return std::uniform_int_distribution{min, max}(default_generator);
}

template&lt;typename T&gt;
inline std::enable_if_t&lt;std::is_floating_point_v&lt;T&gt;, T&gt; getUniformRandom(T min, T max)
{
    static std::mt19937 default_generator(std::random_device{}());
    return std::uniform_real_distribution{min, max}(default_generator);
}