Simplify thread0.cpp and xthrow.cpp. #320
Merged
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.
Description
I verified with
#error
that these files are always compiled with_HAS_EXCEPTIONS=1
.thread0.cpp
Include only necessary headers.
Move the lookup tables within
_STD_BEGIN
to avoid repeated_STD
qualification. They'restatic
, so this doesn't affect bincompat.Add trailing commas for readability.
Make
codes
a table oferrc
so we don't need to cast each value.Mark
_Throw_Cpp_error
as[[noreturn]]
, matching its declaration in the header. (No bincompat effect.)Use
_THROW
for consistency. (Even though exceptions are enabled, we conventionally use this insrc
.)system_error
is a type, so we don't need to_STD
qualify it.static_cast<int>
theerrc
, once.xthrow.cpp
Coalesce headers. Coalesce
std
regions.Remove unnecessary comments.
Mark value parameters as const.
Checklist
Be sure you've read README.md and understand the scope of this repo.
If you're unsure about a box, leave it unchecked. A maintainer will help you.
_Ugly
as perhttps://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
verified by an STL maintainer before automated testing is enabled on GitHub,
leave this unchecked for initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft (including any cited standards), other WG21 papers
(excluding reference implementations outside of proposed standard wording),
and LWG issues as reference material. If they were derived from a project
that's already listed in NOTICE.txt, that's fine, but please mention it.
If they were derived from any other project (including Boost and libc++,
which are not yet listed in NOTICE.txt), you must mention it here,
so we can determine whether the license is compatible and what else needs
to be done.