Skip to content

Conversation

achabense
Copy link
Contributor

@achabense achabense requested a review from a team as a code owner July 10, 2025 05:09
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Jul 10, 2025
Comment on lines +5118 to +5127
tm _Time;
_Time.tm_sec = _Seconds;
_Time.tm_min = _Minutes;
_Time.tm_hour = _Hours;
_Time.tm_mday = static_cast<int>(_Day);
_Time.tm_mon = static_cast<int>(_Month) - 1;
_Time.tm_year = _Year - 1900;
_Time.tm_yday = _Yearday;
_Time.tm_wday = _Weekday;
return _Time;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether it would be better to use designated list-initialization (i.e. return {.tm_sec = _Seconds, /*...*/};) here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which standard mode is this part and which standard ode is this syntax?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which standard mode is this part and which standard ode is this syntax?

Both are C++20.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, _Fill_tm is defined in a #if _HAS_CXX20 scope (from line 2885); looks good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always forget that that's a feature, but I have no objections to its use (unlike abbreviated function templates). In a followup PR, if you want to do this.

@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Jul 10, 2025
@StephanTLavavej
Copy link
Member

Thanks! 😻 The _Fill_tm change is IMO a significant clarity improvement, reducing the scope of a bunch of variables that we don't need to answer those cases.

@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Jul 10, 2025
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Jul 14, 2025
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit dbdb1ea into microsoft:main Jul 15, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Jul 15, 2025
@StephanTLavavej
Copy link
Member

Thanks for simplifying things and avoiding dead code! ❌ 🧟 🎉

@achabense achabense deleted the Issue5605 branch August 3, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Suggestion: put else logic for if-constexpr-return into else scope if possible
4 participants