- random[meta header]
- std[meta namespace]
- discrete_distribution[meta class]
- function[meta id-type]
- cpp11[meta cpp]
result_type max() const;
上限を取得する。
最大のインデックスである「確率列の要素数 - 1」を返す。
#include <iostream>
#include <random>
int main()
{
std::discrete_distribution<> dist = {0.1, 0.2, 0.3};
int max_value = dist.max();
std::cout << max_value << std::endl;
}
- max()[color ff0000]
2
- C++11
- Clang: ??
- GCC: 4.7.2
- ICC: ??
- Visual C++: ??