std::unifor...::operator()(3)
π std::unifor...::operator() π
okay bestie, welcome to the C++ Standard Libary manual page for std::uniform_int_distribution::operator() β yes, the header is all truncated like std::unifor...::operator()(3), but the full name is right down below. Itβs giving βIβm a template operator and I know itβ energy π
β¨
πΈ NAME πΈ
std::uniform_int_distribution::operator() β std::uniform_int_distribution::operator().
Yes, thatβs the name repeated. Iconic. We move. π
β¨ Synopsis β¨
Two template flavors, both (since C++11) β hereβs the exact synopsis, bestie:
template< class Generator > (1)
(since C++11)
result_type operator()( Generator& g );
template< class Generator > (2)
(since C++11)
result_type operator()( Generator& g, const param_type& params );
So what do these do? They generate random numbers that are distributed according to the associated probability function. The entropy is acquired by calling g.operator(). Version (1) uses the associated parameter set; version (2) uses params. The associated parameter set is not modified β important vibe check, no sneaky edits. π«Ά
π¦ Parameters π¦
gβ a uniform random bit generator object.paramsβ distribution parameter set to use instead of the associated one. Slay.
π Type requirements π
Generatormust meet the requirements ofUniformRandomBitGenerator. Thatβs the whole requirement, bestie β no cap. β¨
π Return value π
The generated random number. Periodt. π
π Complexity π
Amortized constant number of invocations of g.operator(). So itβs chillinβ at amortized constant β literally what the page says. π
source/version: cppreference.com Β· date: 2024.06.10 β bye bestie, go generate something cute π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms