Support printing (const) volatile void* - #4056
Conversation
13860e8 to
63fb57c
Compare
There was a problem hiding this comment.
I don't think we need to check various values here, let's get rid of the lambda and just check nullptr.
There was a problem hiding this comment.
I was just being safe to cover the behaviour with iostreams linked in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1147r1.html but if you're happy for it to be removed I'll take it out
63fb57c to
cc5e38f
Compare
cc5e38f to
5e7b6a4
Compare
|
Merged, thanks! |
|
why 4 overloads instead of 1 overload taking a const volatile void*? |
It's a good question. If all we had was 4 overloaded functions ( However, there's also this: Lines 1487 to 1498 in 6a192f8 as we only want to format (const)? (volatile)? void pointers, so this catches other pointer types to render them unformattable. If we remove the first 3 of those, leaving only the It will then go and instantiate the See https://godbolt.org/z/3cTj5xErM and flip the define You could probably get this working with some SFINAE (although I think you'll have a similar issue with getting |
|
making the SFINAE condition
will work. I agree that overloading is easier to reason about. but I just wanted to point it out. |

Fixes #4049