Skip to content

<chrono>: Investigate whether we can rework definition of zoned_time constructor #1910

Description

The Standard defines zoned_time's constructor with recursive constraints. We currently mirror the Standard's definition in our implementation, but we should investigate whether it's possibly to implement them non-recursively.

Examples:
zoned_time(string_view{})

STL/stl/inc/chrono

Lines 2980 to 2984 in 65eb507

template <class _Traits2 = _Traits, enable_if_t<is_constructible< // TRANSITION, VSO-1303556
zoned_time, decltype(_Traits2::locate_zone(string_view{}))>::value,
int> = 0>
// clang-format on
explicit zoned_time(string_view _Name) : _Zone{_Traits::locate_zone(_Name)} {}

zoned_time(string_view, const sys_time))

STL/stl/inc/chrono

Lines 2993 to 2998 in 65eb507

template <class _Traits2 = _Traits, enable_if_t<is_constructible< // TRANSITION, VSO-1303556
zoned_time, decltype(_Traits2::locate_zone(string_view{})), const sys_time<_Duration>&>::value,
int> = 0>
// clang-format on
zoned_time(string_view _Name, type_identity_t<const sys_time<_Duration>&> _Sys)
: zoned_time{_Traits::locate_zone(_Name), _Sys} {}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    chronoC++20 chronofixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions