Title
Constructors of std::chrono::time_zone might be overly unspecified
Status
new
Section
[time.zone.overview]
Submitter
Jiang An

Created on 2022-02-23.00:00:00 last changed 1 week ago

Messages

Date: 2025-03-19.11:57:42

Proposed resolution:

This wording is relative to N5001.

  1. Modify [time.zone.overview] as indicated:

    
    namespace std::chrono {
      class time_zone {
        time_zone(unspecified);
      public:
        time_zone(time_zone&&) = default;
        time_zone& operator=(time_zone&&) = default;
    
        // unspecified additional constructors
    
        [...]
      };
    }

    -1- A `time_zone` represents all time zone transitions for a specific geographic area. `time_zone` construction is unspecified, and performed only as part of database initialization.

    [Note 1: `const time_zone` objects can be accessed via functions such as `locate_zone`. — end note]

Date: 2025-03-15.00:00:00

[ 2025-03-18; Jonathan provides wording ]

I don't think it matters whether they are trivial or constexpr, because they cannot be used. Users only have access to `const time_zone` lvalues via `locate_zone` and the `tzdb::zones` container. The move constructor and move assignment operator only need to exist so that the implementation can populate that container.

Date: 2022-03-15.00:00:00

[ 2022-03-04; Reflector poll ]

Set priority to 4 after reflector poll.

Date: 2022-02-23.00:00:00

In [time.zone.overview], only defaulted move constructor and move assignment operator for std::chrono::time_zone are shown, other constructors are said to be "unspecified additional constructors". Presumably the intent is that the default constructor is not declared (suppressed) and the copy constructor is implicitly deleted, but it is not clear if they are not "unspecified additional constructors" and hence implicitly specified.

On the other hand, the defaulted definitions of move functions bring almost no specification, as no exposition only member is shown. So it is unspecified whether these functions are deleted, trivial, constexpr, or noexcept. Perhaps we want these functions to be non-deleted and noexcept, while triviality and constexpr-ness should be left unspecified.

History
Date User Action Args
2025-03-19 11:57:42adminsetmessages: + msg14689
2025-03-19 11:57:42adminsetmessages: + msg14688
2022-03-04 14:33:52adminsetmessages: + msg12401
2022-02-23 00:00:00admincreate