std::uniform_random_bit_generator(3cxx)
π NAME π
okay so bestie, this is std::uniform_random_bit_generator β and it's literally the requirements for a uniform random bit generator. that's the whole vibe. no cap. β¨
it lives in the 3cxx manual section, in case you were wondering where to find it in your man setup π
β¨ SYNOPSIS β¨
first thing you do, every time, is pull in the goods:
#include <random>
π¦ Concept definition π¦
here's the whole concept, verbatim, because you deserve the real thing and not a paraphrase:
template<typename _Gen>
concept std::uniform_random_bit_generator = invocable<_Gen&> && unsigned_integral<invoke_result_t<_Gen&>>
&& requires
{
{ _Gen::min() } -> same_as<invoke_result_t<_Gen&>>;
{ _Gen::max() } -> same_as<invoke_result_t<_Gen&>>;
requires bool_constant<(_Gen::min() < _Gen::max())>::value;
}
likeβ¦ look at her. she's doing so much. _Gen& has to be invocable, the result of invoking it has to be an unsigned integral type, _Gen::min() and _Gen::max() both have to return exactly that same type, and _Gen::min() has to be strictly less than _Gen::max(). the way that she checks all of that at compile time ππ
πΈ Detailed Description πΈ
Requirements for a uniform random bit generator. π
Since
C++20 β
fr fr, if your compiler isn't feeling C++20, this concept is not gonna show up for you. that's just the situation.
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. π€ (not me writing this by hand, the robot did it, but I'm the one making it cute π«Ά)
and that's the whole page bestie!! this one came out of libstdc++ β the footer even reads libststd::uniform_random_bit_generator(3cxx), which, yeah, that's what it says, I'm not editing it, I'm just reporting it πβ¨ go forth and generate your bits, uniformly, iconic behaviour only ππ
π¦ where this page comes from
- ubuntu resolute: libstdc++-13-doc 13.4.0-10ubuntu1
- ubuntu resolute: libstdc++-16-doc 16-20260322-1ubuntu1
- ubuntu stonking: libstdc++-13-doc 13.5.0-1ubuntu1
- ubuntu stonking: libstdc++-16-doc 16.2.0-3ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms