Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 1.49 KB

File metadata and controls

65 lines (51 loc) · 1.49 KB

operator<

  • chrono[meta header]
  • std::chrono[meta namespace]
  • function template[meta id-type]
  • cpp11[meta cpp]
namespace std {
namespace chrono {
  template <class Clock, class Duration1, class Duration2>
  bool operator<(const time_point<Clock, Duration1>& lhs,
                 const time_point<Clock, Duration2>& rhs);           // C++11

  template <class Clock, class Duration1, class Duration2>
  constexpr bool operator<(const time_point<Clock, Duration1>& lhs,
                           const time_point<Clock, Duration2>& rhs); // C++14
}}
  • time_point[link /reference/chrono/time_point.md]

概要

左辺が右辺より小さいか判定を行う

戻り値

return lhs.time_since_epoch() < rhs.time_since_poch();
  • time_since_spoch[link /reference/chrono/time_point/time_since_epoch.md]

#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);
}
  • p1 < p2[color ff0000]
  • system_clock[link /reference/chrono/system_clock.md]
  • seconds[link /reference/chrono/seconds.md]

出力

バージョン

言語

  • C++11

処理系

参照