最終更新日時(UTC):
が更新

履歴 編集

function template
<random>

std::operator==(C++11)

namespace std {
  template <class Engine, size_t W, class UIntType>
  bool operator==(
    const independent_bits_engine<Engine, W, UIntType>& x,
    const independent_bits_engine<Engine, W, UIntType>& y);
}

概要

等値比較を行う。

戻り値

xyの状態シーケンスの、全ての値を等値比較し、等しければtrue、そうでなければfalseを返す。

計算量

O(状態シーケンスのサイズ)

#include <iostream>
#include <random>
#include <cstdint>

int main()
{
  using engine_type = std::independent_bits_engine<std::mt19937, 64, std::uint64_t>;

  engine_type e1;
  engine_type e2;

  if (e1 == e2) {
    std::cout << "equal" << std::endl;
  }
  else {
    std::cout << "not equal" << std::endl;
  }
}

出力

equal

バージョン

言語

  • C++11

処理系

参照