3209. Expression in year::ok() returns clause is ill-formed

Section: [time.cal.year.members] Status: C++20 Submitter: Tomasz Kamiński Opened: 2019-05-28 Last modified: 2021-02-25 10:48:01 UTC

Priority: 0

View all issues with C++20 status.


The expression in the Returns element of year::ok in [time.cal.year.members] p18:

min() <= y_ && y_ <= max()

is ill-formed, as it attempts to compare type short (type of y_ member) with type year (type of year::min() and year::max()).

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

Proposed resolution:

This wording is relative to N4810.

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

    constexpr bool ok() const noexcept;

    -18- Returns: min().y_ <= y_ && y_ <= max().y_.