Issue 4067: Inconsistency and potential infinity meta-recursion in std::chrono::zoned_time's constructors (original) (raw)

-?- Let _locatable-as-tzptr_ be true if given an lvalue sv of type string_view, traits::locate_zone(sv) is well-formed and TimeZonePtr is implicitly convertible from its return type, and false otherwise. Only the validity of the immediate context of the invocation and conversion is considered.

-?- In every constructor that takes a string_view parameter name, let _converted-tzptr_ be a variable of type TimeZonePtr that is copy-initialized from traits::locate_zone(name).

[…]

explicit zoned_time(string_view name);

-7- Constraints: traits::locate_zone(string_view{}) is a well-formed expression and zoned_time is constructible from the return type of traits::locate_zone(string_view{}) _locatable-as-tzptr_ is true.

-8- Effects: Initializes zone_ with traits::locate_zone(name) and default constructs tp_.

[…]

zoned_time(string_view name, const sys_time& st);

-13- Constraints: zoned_time is constructible from the return type of traits::locate_zone(name) and st_locatable-as-tzptr_ is true.

-14- Effects: Equivalent to construction with {~~traits::locate_zone(name)~~std::move(_converted-tzptr_), st}.

[…]

zoned_time(string_view name, const local_time& tp);

-18- Constraints: _locatable-as-tzptr_ is true and zoned_time is constructible from the return type of traits::locate_zone(name)TimeZonePtr and tp.

-19- Effects: Equivalent to construction with {~~traits::locate_zone(name)~~std::move(_converted-tzptr_), tp}.

[…]

zoned_time(string_view name, const local_time& tp, choose c);

-23- Constraints: _locatable-as-tzptr_ is true and zoned_time is constructible from the return type of traits::locate_zone(name)TimeZonePtr, local_time<Duration>, and choose.

-24- Effects: Equivalent to construction with {~~traits::locate_zone(name)~~std::move(_converted-tzptr_), tp, c}.

[…]

template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y);

-32- Constraints: _locatable-as-tzptr_ is true and zoned_time is constructible from the return type of traits::locate_zone(name)TimeZonePtrand the type zoned_time<Duration2, TimeZonePtr2>.

-33- Effects: Equivalent to construction with {~~traits::locate_zone(name)~~std::move(_converted-tzptr_), y}.

template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y, choose c);

-34- Constraints: _locatable-as-tzptr_ is true and zoned_time is constructible from the return type of traits::locate_zone(name)TimeZonePtr, the type zoned_time<Duration2, TimeZonePtr2>, and the type choose.

-35- Effects: Equivalent to construction with {~~traits::locate_zone(name)~~std::move(_converted-tzptr_), y, c}.