[libcxx-commits] [PATCH] D129716: [libc++][NFC] Use is_void instead of is_same<void, ...>

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 19 13:31:30 PDT 2022


Mordante added a comment.

In D129716#3658316 <https://reviews.llvm.org/D129716#3658316>, @philnik wrote:

> In D129716#3655911 <https://reviews.llvm.org/D129716#3655911>, @Mordante wrote:
>
>> Can you explain what the benefit of this change is? And why the different behaviour of `std::same_as` and `std::is_void_v` is not an issue. I'm not even sure we should call this an NFC patch.
>>
>> In general it would be good to add this kind of information to the commit message/review description.
>
> The benefit is that it's a bit easier to read IMO. The different behaviour isn't an issue in the first three files, because it just checks that `__make_32_64_or_128_bit_t` or the conditional succeeded, which indicate a failure as `void`. The two tests check that the return type is void. There it isn't a problem, because cv-qualifiers on return types are discarded. IOW `const void func(); static_assert(std::is_same_v<void, decltype(func())>);` is a correct program.

For me it's the opposite; I wonder what `const void` would mean in that context. The code in `charconv` and `format` is written by me and I didn't use `is_void_v` since to me the current syntax is easier to read.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129716/new/

https://reviews.llvm.org/D129716



More information about the libcxx-commits mailing list