Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C++ named requirements:Clock(since C++11)

      From cppreference.com
      <cpp‎ |named req
       
       
      C++ named requirements
       

      TheClock requirements describe a bundle consisting of astd::chrono::duration, astd::chrono::time_point, and a functionnow() to get the currenttime_point. The origin of the clock'stime_point is referred to as the clock's epoch.

      [edit]Requirements

      C1 andC2 denote clock types.t1 andt2 are values returned byC1::now() where the call returningt1 happens before the call returningt2 and both of these calls occur beforeC1::time_point::max().

      ExpressionReturn typeOperational semantics
      C1::repAn arithmetic type or a class emulating an arithmetic typeThe representation type ofC1::duration.
      C1::periodA specialization ofstd::ratioThe tick period of the clock in seconds.
      C1::durationstd::chrono::duration<C1::rep, C1::period>The duration type of the clock.
      C1::time_pointstd::chrono::time_point<C1> orstd::chrono::time_point<C2, C1::duration>Thestd::chrono::time_point type of the clock. C1 and C2 shall refer to the same epoch.
      C1::is_steadyconstbooltrue ift1<= t2 is alwaystrue and the clock advances at a steady rate relative to real time (so the difference between two distinct reported times is approximately the elapsed real time between the clock updates), otherwisefalse
      C1::now()C1::time_pointReturns atime_point object representing the current point in time.

      [edit]See also

      determines if a type is aClock
      (class template)(variable template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req/Clock&oldid=144944"

      [8]ページ先頭

      ©2009-2025 Movatter.jp