-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Various cleanups: <chrono>
#4119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Stephan T. Lavavej (StephanTLavavej)
merged 20 commits into
microsoft:main
from
StephanTLavavej:dry-cleaning-3-chrono-cleanups
Oct 26, 2023
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
db3c7a1
chrono cleanups: Make `_THROW` a variadic macro so we never need extr…
StephanTLavavej af77711
chrono cleanups: Replace `decltype(tzdb::zones)` and `decltype(tzdb::…
StephanTLavavej 3cb601f
chrono cleanups: `_Crt_allocator` should provide equality.
StephanTLavavej e6f5cb3
chrono cleanups: `time_zone` and `time_zone_link`'s internal construc…
StephanTLavavej 67ab97d
chrono cleanups: Return `const char*` as `string` without braces.
StephanTLavavej de87607
chrono cleanups: Extract `_Make_unique_tzdb_info()`.
StephanTLavavej aa16fb5
chrono cleanups: `exchange()` the contained value instead of the enti…
StephanTLavavej 423374f
chrono cleanups: Use positive test and early `return`.
StephanTLavavej d6179a1
chrono cleanups: Drop empty line at the top of `_Make_time_point()`.
StephanTLavavej b3a28bd
chrono cleanups: Consistently say "leap second deletion" in comments.
StephanTLavavej aff9642
chrono cleanups: `_InIt` is always `istreambuf_iterator`, not an arbi…
StephanTLavavej 29ee886
chrono cleanups: Use `const auto&` to avoid `_Ctype` typedef.
StephanTLavavej d99cc4f
chrono cleanups: `'q'` and `'Q'` should always be given `duration`s, …
StephanTLavavej 386d32f
chrono cleanups: Avoid dead `return`s after `if constexpr`.
StephanTLavavej 12caeeb
chrono cleanups: `_Is_any_of_v` => `is_same_v` for one type.
StephanTLavavej 1fdf9b5
chrono test cleanups: Drop separate `res` variable used during debugg…
StephanTLavavej 5a51fcc
chrono test cleanups: Consistently make `invalid` variables `constexpr`.
StephanTLavavej 2919534
chrono cleanups: Drop performance note.
StephanTLavavej cde007a
chrono cleanups: Comment why `++_Begin` is safe.
StephanTLavavej 15223ed
chrono cleanups: Use `ios_base` with `_CATCH_IO_`.
StephanTLavavej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -451,8 +451,8 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa | |
| catch (...) { | ||
| #define _CATCH_END } | ||
|
|
||
| #define _RERAISE throw | ||
| #define _THROW(x) throw x | ||
| #define _RERAISE throw | ||
| #define _THROW(...) throw __VA_ARGS__ | ||
|
|
||
| #else // ^^^ _HAS_EXCEPTIONS / !_HAS_EXCEPTIONS vvv | ||
| #define _TRY_BEGIN \ | ||
|
|
@@ -475,7 +475,7 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa | |
| #endif | ||
|
|
||
| #define _RERAISE | ||
| #define _THROW(x) x._Raise() | ||
| #define _THROW(...) __VA_ARGS__._Raise() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto I'll add this to my next batch of cleanups. Thanks! |
||
| #endif // ^^^ !_HAS_EXCEPTIONS ^^^ | ||
| _STD_END | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-existing: Should we wrap
()around the arguments in the expansion to avert weirdness?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be reasonable;
throwhas extremely low precedence but that is conventional for macros. I'll do this in a followup.