[libcxx-commits] [PATCH] D97115: [libc++] Make chars_format a bitmask type.
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Feb 22 22:59:12 PST 2021
Mordante added inline comments.
Comment at: libcxx/include/charconv:111
+using __chars_format_underlying_type = underlying_type<chars_format>::type;
> curdeius wrote:
> > Would adding `to_underlying` helper be cleaner?
> > Something along the lines of the proposed http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1682r1.html. WDYT?
> I hadn't seen that paper yet, but it seems very useful. According to to https://github.com/cplusplus/papers/issues/460 it seems to be on track to land in C++23. I'm somewhat tempted to implement `__to_underlying` in `utility` for C++11 for now and also adjust the other bitmask types. Then we can switch to `to_underlying` or add a C++17 `to_underlying` once the paper lands. @ldionne What's your opinion?
This comment aged fast; according to Herb P1682 has been adopted . I'll create a patch to implement it. I think it makes sense to allow its usage in C++11 or do we prefer C++23 only? In that case I'll add a private function for C++11 which is used by the C++23 public version.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libcxx-commits