-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement char8_t compatibility remedies #470
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
Conversation
| @@ -912,15 +912,46 @@ basic_ostream<char, _Traits>& operator<<( | |||
| } | |||
|
|
|||
| #ifdef __cpp_char8_t // These deleted overloads are specified in P1423. | |||
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.
Note to other reviewers: This means the char8_t overloads continue to be deleted even in sub-C++20 mode (e.g., if compiling with e.g. /std:c++17 /Zc:char8_t). I'm fine with this inconsistent behavior of char8_t vs. char16_t/char32_t, shout if you are not.
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's fine, in any case only "he who likes pain" will use char8_t in C++20... Now, where is that Jens Gustedt pdf on modern C ... sorry talking to myself, have to go now... Good work Casey, thanks a lot, see you ...
Co-Authored-By: Casey Carter <cartec69@gmail.com>
|
Thanks a lot @CaseyCarter. |
Heh - I grabbed this since (a) I implemented the original void
print_log_value<wchar_t const*>::operator()( std::ostream& ostr, wchar_t const* t )
{
ostr << ( t ? t : L"null string" );
}in the Boost unit test library (reported at boostorg/test#249). |
|
@CaseyCarter Thanks for the fix, although I would suggest to change it in a way compatible with #380 If it is ok for you I would rebase it on #380 and use the convention established there: #ifndef _HAS_STREAM_INSERTIONS_REMOVED_BY_P1423
#define _HAS_STREAM_INSERTIONS_REMOVED_BY_P1423 (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_STREAM_INSERTIONS_REMOVED_BY_P1423and then guard those with #if _HAS_STREAM_INSERTIONS_REMOVED_BY_P1423Also is the paper really needed in the name? |
We didn't give the macro name a ton of thought beyond the fact that only I thought Does that sound good? |
…t-; rename escape hatch
|
I am totally fine with the name. |
|
Thanks for your contribution! |
Description
This addresses #59 by adding the missing deleted overloads to
basic_ostream<meow>::operator<<(bark)The other changesin that proposal have already been implemented. As there was no switch the changes have been implemented unconditionally.
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.
_Uglyas 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.