[libcxx-commits] [PATCH] D97115: [libc++] Make chars_format a bitmask type.
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Apr 4 06:28:21 PDT 2021
Quuxplusone added inline comments.
================
Comment at: libcxx/test/std/utilities/charconv/charconv.syn/chars_format.pass.cpp:69
+ ((~std::chars_format::hex & std::chars_format::general) ==
+ std::chars_format::general);
+}
----------------
Mordante wrote:
> Quuxplusone wrote:
> > Please rewrite this function to use `assert(x); assert(y); assert(z); return true;`
> > instead of `return x && y && z;`
> I personally prefer to write the code as you suggested, in fact I originally wrote it like that. Unfortunately `assert` can't be used in a constexpr function in C++11. Hence this comment at line 48: "This construction is used to make the function constexpr in C++11."
<charconv> was introduced in C++17. Anyone still using C++11 constexpr in the year of our lord 2021 deserves what they get.
If you need to add `UNSUPPORTED: c++11` to this test in order to use the preferred style, I think that's a good tradeoff. @ldionne, thoughts?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97115/new/
https://reviews.llvm.org/D97115
More information about the libcxx-commits
mailing list