The TrivialClock requirements describe the requirements satisfied by several clocks in the chrono library.
Requirements
For a type TC:
- The type must meet Clock requirements.
- The types
TC::rep,TC::duration, andTC::time_pointsatisfy the requirements of EqualityComparable, LessThanComparable, DefaultConstructible, CopyConstructible, CopyAssignable, Destructible(until C++17), Swappable, and NumericType. - The function
TC::now()does not throw exceptions. - The type
TC::time_point::clockmeets the TrivialClock requirements, recursively.
Standard library
The following types in the standard library satisfy TrivialClock requirements:
| (C++11) |
wall clock time from the system-wide realtime clock (class) |
| (C++11) |
monotonic clock that will never be adjusted (class) |
| (C++11) |
the clock with the shortest tick period available (class) |
| (C++20) |
Clock used for file time (typedef) |
| (C++17) |
represents file time values (typedef) |
Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.