namespace std {
template <class IntType>
bool operator==(
const uniform_int_distribution<IntType>& a,
const uniform_int_distribution<IntType>& b);
}
概要
等値比較を行う。
戻り値
a.param() == b.param()
であり、かつa(g)
によって生成される値の無限シーケンスS1
、b(g)
によって生成される値の無限シーケンスS2
が等しい場合true
を返し、そうでなければfalse
を返す。
計算量
定数時間
例
#include <iostream>
#include <random>
int main()
{
std::uniform_int_distribution<> a(0, 3);
std::uniform_int_distribution<> b(0, 3);
if (a == b) {
std::cout << "equal" << std::endl;
}
else {
std::cout << "not equal" << std::endl;
}
}
出力
equal
バージョン
言語
- C++11
処理系
- Clang: ??
- GCC: 4.7.2 ✅
- ICC: ??
- Visual C++: ??