This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

3678. Constructors of std::chrono::time_zone might be overly unspecified

Section: 30.11.5.1 [time.zone.overview] Status: New Submitter: Jiang An Opened: 2022-02-23 Last modified: 2025-03-19

Priority: 4

View all issues with New status.

Discussion:

In 30.11.5.1 [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.

[2022-03-04; Reflector poll]

Set priority to 4 after reflector poll.

[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.

Proposed resolution:

This wording is relative to N5001.

  1. Modify 30.11.5.1 [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]