Created on 2019-06-23.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4849.
Modify [time.zone.zonedtime.overview], class template zoned_time synopsis, as indicated:
template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt); template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt, choose);
Modify [time.zone.zonedtime.ctor] as indicated:
template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y);-32- Constraints: zoned_time is constructible from the return type of traits::locate_zone(name) and zoned_time<Duration2, TimeZonePtr2>.
-33- Effects: Equivalent to construction with {traits::locate_zone(name), y}.template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y, choose c););-34- Constraints: zoned_time is constructible from the return type of traits::locate_zone(name), zoned_time<Duration2, TimeZonePtr2>, and choose.
-35- Effects: Equivalent to construction with {traits::locate_zone(name), y, c}. -36- [Note: The choose parameter has no effect. — end note]
[ 2020-02 Status to Immediate on Thursday morning in Prague. ]
[ 2020-02-13, Prague ]
During LWG discussions it was suggested to rebase the wording to reduce the chances for confusion.
zoned_time
constructors with string_view
and
another zoned_time
are not accepting zoned_time
instances that use a different time zone representation (TimeZonePtr
parameter):
zoned_time(string_view name, const zoned_time<Duration>& zt); zoned_time(string_view name, const zoned_time<Duration>& zt, choose);
This makes them inconsistent with the constructors from TimeZonePtr
and zoned_time
, that they delegate to:
template<class Duration2, class TimeZonePtr2> zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& zt); template<class Duration2, class TimeZonePtr2> zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& zt, choose);
Furthermore it forces the creation of a temporary zoned_time
object in
case when the source uses the same TimeZonePtr
, but different Duration
.
This wording is relative to N4820.
Modify [time.zone.zonedtime.overview], class template zoned_time synopsis, as indicated:
template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt); template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt, choose);Modify [time.zone.zonedtime.ctor] as indicated:
template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y);-32- Remarks: This constructor does not participate in overload resolution unless zoned_time is constructible from the return type of traits::locate_zone(name) and zoned_time<Duration2, TimeZonePtr2>.
-33- Effects: Equivalent to construction with {traits::locate_zone(name), y}.template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y, choose c););-34- Remarks: This constructor does not participate in overload resolution unless zoned_time is constructible from the return type of traits::locate_zone(name), zoned_time<Duration2, TimeZonePtr2>, and choose.
-35- Effects: Equivalent to construction with {traits::locate_zone(name), y, c}. -36- [Note: The choose parameter has no effect. — end note]
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2020-02-24 16:02:59 | admin | set | status: immediate -> wp |
2020-02-13 12:32:11 | admin | set | messages: + msg11055 |
2020-02-13 12:32:11 | admin | set | status: new -> immediate |
2020-02-13 10:43:00 | admin | set | messages: + msg11051 |
2019-06-23 14:15:50 | admin | set | messages: + msg10463 |
2019-06-23 00:00:00 | admin | create |