On Thu, Aug 08, 2024 at 10:01:14PM +0200, Alejandro Colomar wrote:
> ./libstdc++-v3/testsuite/21_strings/basic_string/cons/char/constexpr.cc:62:
>         const auto len = (sizeof(cs) - 1)/sizeof(C);
> ./libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/constexpr.cc:62:
>         const auto len = (sizeof(cs) - 1)/sizeof(C);
> 
> Which would read better as sizeof/sizeof - 1.
> 
> There are others which also could be improved in readability terms, but
> I don't think it's worth bikeshedding that at the moment.  If you do a
> global switch to ARRAY_SIZE(), I can help with those.  I'll keep the
> commit in the backyard in case we need it for something.

E.g. in testcases, we definitely don't want to use ARRAY_SIZE, at least most
of them should be self-contained if possible, include as few headers as
posible etc.

        Jakub

Reply via email to