cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

GB335 27.07.1.1 Clarify whether clocks can represent time before their epoch LWG 3318 #331

Closed wg21bot closed 4 years ago

wg21bot commented 4 years ago

Wording for clocks should be unified unless they are intended to behave differently In 27.7.1.1 note 1 for system_clock it is stated "Objects of type system_clock represent wall clock time from the system-wide realtime clock. Objects of type sys_time<Duration> measure time since (and before) 1970-01-01 00:00:00 UTC" The express statement of "since (and before)" is important given the time epoch of these clocks. If all the clocks support time prior to their zero-time then this should be stated explicitly. If not then likewise that should be noted. No change is proposed yet, clarification required over the intended behaviour when using values prior to a given clock's epoch is needed before the appropriate change can be suggested.

Proposed change: Unify the wording

HowardHinnant commented 4 years ago

Each std-defined clock has a nested type rep. For each clock, this type is defined to be either "a signed arithmetic type", or "unspecified". For each clock that is specified to have a signed arithmetic rep, the intention is that they support negative time_points.

The clocks with a signed arithmetic rep are:

The clocks with an unspecified rep are:

Note that for the clocks in this latter group, rep is not completely unspecified. These clocks still have to meet the Cpp17Clock requirements [time.clock.req] which specifies rep to be:

An arithmetic type or a class emulating an arithmetic type

jwakely commented 4 years ago

Reviewed by LWG small group on Monday morning.

Dani-Hub commented 4 years ago

The associated issue is LWG 3318

JeffGarland commented 4 years ago

Issue moved to ready as of 2019-11-07