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

履歴 編集

function template
<chrono>

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

namespace std {
namespace chrono {
  // operator==により、以下の演算子が使用可能になる (C++20)
  template <class Clock, class Duration1, class Duration2>
  bool operator!=(const time_point<Clock, Duration1>& lhs,
                  const time_point<Clock, Duration2>& rhs);           // (1) C++11

  template <class Clock, class Duration1, class Duration2>
  constexpr bool operator!=(const time_point<Clock, Duration1>& lhs,
                            const time_point<Clock, Duration2>& rhs); // (1) C++14
}}

概要

非等値比較を行う

戻り値

!(lhs == rhs)

#include <cassert>
#include <chrono>

using namespace std::chrono;

int main()
{
  time_point<system_clock> p1(seconds(2));
  time_point<system_clock> p2(seconds(3));

  const bool result = p1 != p2;
  assert(result);
}

出力

バージョン

言語

  • C++11

処理系

参照