tomaszkam / date

A date and time library based on the C++11/14/17 <chrono> header
Other
0 stars 0 forks source link

[LWG3225] zoned_time converting constructor shall not be noexcept #17

Closed tomaszkam closed 5 years ago

tomaszkam commented 5 years ago

Orginal comment:

Remove noexcept from:

template zoned_time(const zoned_time& zt) noexcept;

E-mail conversation: [isocpp-lib] zoned_time issues

tomaszkam commented 5 years ago

Discussion: The zoned_time constructor from zoned_time<Duration2, TimeZonePtr> (preserving same time zone, different precision of representation) is current marked noexcept. This is incompatible with invoked time_point constructor, that is not marked as noexcept.

Proposed wording: Apply the following changes to [time.zone.zonedtime.overview]:

 template<class Duration2>
      zoned_time(const zoned_time<Duration2, TimeZonePtr>& zt) noexcept;

Apply the following changes to [time.zone.zonedtime.ctor]:

 template<class Duration2>
      zoned_time(const zoned_time<Duration2, TimeZonePtr>& zt) noexcept;

Remarks: Does not participate in overload resolution unless sys­time is implicitly convertible to sys­time.

Effects: Constructs a zoned­time by initializing zone­ with y.zone­ and tp­ with y.tp_­.