zoned_time
converting constructor shall not be noexcept
Section: 30.11.7.2 [time.zone.zonedtime.ctor] Status: C++20 Submitter: Tomasz Kamiński Opened: 2019-06-20 Last modified: 2021-02-25
Priority: 0
View all other issues in [time.zone.zonedtime.ctor].
View all issues with C++20 status.
Discussion:
The zoned_time
constructor from zoned_time<Duration2,
TimeZonePtr>
(preserving same time zone, different precision of
representation) is currently marked noexcept
. Given that the exposition-only
member tp_
of type sys_time<duration>
has essentially type
time_point<system_clock, Duration>
, this is incompatible with the
invoked time_point
constructor, which is not marked as noexcept
.
[2019-07 Issue Prioritization]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4820.
Modify 30.11.7.1 [time.zone.zonedtime.overview], class template zoned_time
synopsis,
as indicated:
template<class Duration2> zoned_time(const zoned_time<Duration2, TimeZonePtr>& zt)noexcept;
Modify 30.11.7.2 [time.zone.zonedtime.ctor] as indicated:
template<class Duration2> zoned_time(const zoned_time<Duration2, TimeZonePtr>& y)noexcept;-9- Requires: Does not participate in overload resolution unless
-10- Effects: Constructs asys_time<Duration2>
is implicitly convertible tosys_time<Duration>
.zoned_time
by initializingzone_
withy.zone_
andtp_
withy.tp_
.