Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::random_device::operator()

Generates a non-deterministic uniformly-distributed random value.

NotebookLM
result_type operator()();
(since C++11)

Generates a non-deterministic uniformly-distributed random value.

Parameters

(none)

Return value

A random number uniformly distributed in [min(), max()].

Exceptions

Throws an implementation-defined exception derived from std::exception if a random number could not be generated.

See also

[static]
gets the smallest possible value in the output range
(public static member function)
[static]
gets the largest possible value in the output range
(public static member function)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.