Title
year_month_day_last::day specification does not cover !ok() values
Status
c++20
Section
[time.cal.ymdlast.members]
Submitter
Tomasz Kamiński

Created on 2019-06-29.00:00:00 last changed 38 months ago

Messages

Date: 2019-07-29.16:32:11

Proposed resolution:

This wording is relative to N4820.

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

    constexpr chrono::day day() const noexcept;
    

    -13- Returns: If ok() is true, returns aA day representing the last day of the (year, month) pair represented by *this. Otherwise the returned value is unspecified.

    -14- [Note: This value may be computed on demand. — end note]

Date: 2019-08-23.18:06:54

[ 2019-07 Issue Prioritization ]

Status to Tentatively Ready after five positive votes on the reflector.

Date: 2019-06-29.00:00:00

The current specification of the year_month_day_last::day function does not cover the behaviour in the situation when year_month_day_last value is not ok(). To illustrate the sentence from [time.cal.ymdlast.members] p13:

A day representing the last day of the (year, month) pair represented by *this.

is unclear in the situation when month member has !ok value, e.g. what is last day of 14th month of 2019.

The proposed resolution makes the value of ymdl.day() (and by consequence conversion to sys_days/local_days) unspecified if ymdl.ok() is false. This make is consistent with rest of the library, that produces unspecified values in similiar situation, e.g.: [time.cal.ymd.members] p18, [time.cal.ymwd.members] p19, [time.cal.ymwdlast.members] p14.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2019-11-19 14:48:30adminsetstatus: voting -> wp
2019-10-07 02:48:00adminsetstatus: ready -> voting
2019-07-23 15:26:26adminsetmessages: + msg10512
2019-07-23 15:26:26adminsetstatus: new -> ready
2019-06-30 19:04:37adminsetmessages: + msg10475
2019-06-29 00:00:00admincreate