This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.
Section: 30.3 [time.clock.req] Status: C++11 Submitter: Pete Becker Opened: 2009-01-07 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [time.clock.req].
View all issues with C++11 status.
Discussion:
30.3 [time.clock.req] uses the word "native" in several places,
but doesn't define it. What is a "native duration"?
[ 2009-05-10 Howard adds: ]
The standard uses "native" in several places without defining it (e.g. 5.13.3 [lex.ccon]). It is meant to mean "that which is defined by the facility", or something along those lines. In this case it refers to the nested
time_pointanddurationtypes of the clock. Better wording is welcome.
[ Batavia (2009-05): ]
Move to Open pending proposed wording from Pete.
[ 2009-10-23 Pete provides wording: ]
[ 2009-11-18 Daniel adds: ]
I see that 32.6.4.3 [thread.timedmutex.requirements]/3 says:
Precondition: If the tick
periodofrel_timeis not exactly convertible to the native tickperiod, thedurationshall be rounded up to the nearest native tickperiod.I would prefer to see that adapted as well. Following the same style as the proposed resolution I come up with
Precondition: If the tick
periodofrel_timeis not exactly convertible to thenativetickperiodof the execution environment, thedurationshall be rounded up to the nearestnativetickperiodof the execution environment.
[ 2010-03-28 Daniel synced wording with N3092 ]
[ Post-Rapperswil, Howard provides wording: ]
Moved to Tentatively Ready with revised wording from Howard Hinnant after 5 positive votes on c++std-lib.
[ Adopted at 2010-11 Batavia ]
Proposed resolution:
Change 30.3 [time.clock.req]:
1 A clock is a bundle consisting of a
nativeduration, anativetime_point, and a functionnow()to get the currenttime_point. The origin of the clock'stime_pointis referred to as the clock's epoch. A clock shall meet the requirements in Table 56.2 ...
Table 56 — Clock requirements Expression Return type Operational semantics C1::repAn arithmetic type or a class emulating an arithmetic type The representation type of the nativeC1::duration.andtime_point.C1::period... ... C1::durationchrono::duration<C1::rep, C1::period>The nativedurationtype of the clock.C1::time_pointchrono::time_point<C1>orchrono::time_point<C2, C1::duration>The nativetime_pointtype of the clock.C1andC2shall refer to the same epoch....