Closed tomaszkam closed 5 years ago
Discussion:
zoned_time
constructors from string_view
and other zoned_time
are not accepting zoned_time
instances, that use different time zone representation (TimeZonePtr
parameter). This make them inconsistent with constructors from TimeZonePtr
and zoned_time
, that they delegate to. Furthermore it forces creation of temporary zoned_time
object in case if source uses the same TimeZonePtr
, but different Duration
.
Proposed wording: Apply the following changes to [time.zone.zonedtime.overview]:
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)
Apply the following changes to [time.zone.zonedtime.ctor]:
template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt);
Remarks: This constructor does not participate in overload resolution unless zonedtime is constructible from the return type of traits::locate
zone(name) and zonedtime<Duration2, TimeZonePtr2>
.
Effects: Equivalent to construction with {traits::locatezone(name), y}
.
template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt, choose)
Remarks: This constructor does not participate in overload resolution unless zonedtime is constructible from the return type of traits::locate
zone(name), zoned_time<Duration2, TimeZonePtr2>
, and choose
.
Effects: Equivalent to construction with {traits::locate_zone(name), y, c}
.
[ Note: The choose parameter has no effect. — end note ]
Original comment:
E-mail conversation: [isocpp-lib] zoned_time issues