名稱空間
變體
操作

std::random_device::operator()

來自 cppreference.com
< cpp‎ | 數值‎ | 隨機‎ | 隨機裝置
 
 
 
 
 
result_type operator()();
(C++11 起)

生成一個非確定性的均勻分佈隨機值。

目錄

[編輯] 引數

(無)

[編輯] 返回值

一個在 [min(), max()] 範圍內均勻分佈的隨機數。

[編輯] 異常

如果無法生成隨機數,則丟擲實現定義的、派生自 std::exception 的異常。

[編輯] 參閱

[靜態]
獲取輸出範圍中的最小可能值
(public static 成員函式) [編輯]
[靜態]
獲取輸出範圍中的最大可能值
(public static 成員函式) [編輯]