-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
StringMaker<wchar_t> fail to compile with C++20 enabled (GCC) #357
Comments
Thanks for reporting this. I'll take a look when I have some time - this is indeed very important. I wonder if it would be good enough to do a preprocessor comparison check against |
There are two distinct problems here:
recap: current code fails to compile (minimal example)
fails. This leads us to the problem number 2. The question is what are the implications of that difference in behaviour of |
The implications of just fixing the compile error are that when an assert fails with However, I see that in the fixed code |
I didn't had much time lately but finally I came up with a solution which don't require any additional C++ headers. BTW, my previous example wasn't working correctly and to be honest I don't really know why. So I did a different approach: https://godbolt.org/z/dyPFTb |
I'll probably try this in a branch and see what the CI has to say about it - thanks! |
No problem. I can open pull request with that change if you like. |
sounds good! |
I believe this issue can be closed now. Thanks for merging the patch! ;-) |
Description
StringMaker
is usinghas_insertion_operator
trait to check whether type T is accepted bystd::ostream operator <<
. In C++20 bunch of operator<< overloads were explicitly deleted, see https://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt2 causing compilation error.For me, the alternative form of
has_insertion_operator
worked well (note this is slightly changed version of an answer found on stackoverflow):this won't fail to compile and will produce
false
for deleted overloads of operator <<.Steps to reproduce
compile with
-std=c++20
Extra information
The text was updated successfully, but these errors were encountered: