Title
year_month_day conversion to sys_days uses not-existing member function
Status
c++20
Section
[time.cal.ymd.members]
Submitter
Tomasz Kamiński

Created on 2019-05-19.00:00:00 last changed 45 months ago

Messages

Date: 2019-06-08.14:29:37

Proposed resolution:

This wording is relative to N4810.

  1. Modify [time.cal.ymd.members] as indicated:

    constexpr operator sys_days() const noexcept;
    

    -18- Returns: If ok(), returns a sys_days holding a count of days from the sys_days epoch to *this (a negative value if *this represents a date prior to the sys_days epoch). Otherwise, if y_.ok() && m_.ok() is true, returns sys_days{y_/m_/1d} + (d_ - 1d)a sys_days which is offset from sys_days{y_/m_/last} by the number of days d_ is offset from sys_days{y_/m_/last}.day(). Otherwise the value returned is unspecified.

Date: 2019-06-15.00:00:00

[ 2019-06-08; Priority to 0 and Status to Tentatively Ready after six positive votes on the reflector. ]

Date: 2019-05-19.00:00:00

The current specification of the year_month_day conversion function to sys_days, uses the day member function on the sys_days (a.k.a. time_point<system_clock, days>), that does not exist.

In [time.cal.ymd.members] p18, the expression sys_days{y_/m_/last}.day() is ill-formed:

[…] Otherwise, if y_.ok() && m_.ok() is true, returns a sys_days which is offset from sys_days{y_/m_/last} by the number of days d_ is offset from sys_days{y_/m_/last}.day(). Otherwise the value returned is unspecified.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2019-07-22 15:46:37adminsetstatus: voting -> wp
2019-06-17 05:25:36adminsetstatus: ready -> voting
2019-06-08 14:29:37adminsetmessages: + msg10418
2019-06-08 14:29:37adminsetstatus: new -> ready
2019-05-26 14:49:03adminsetmessages: + msg10409
2019-05-19 00:00:00admincreate