[libcxx-commits] [PATCH] D97365: [libc++] [C++2b] [P1682] Add to_underlying.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 25 10:07:07 PST 2021


Mordante accepted this revision.
Mordante added a comment.

One small request otherwise LGTM.



================
Comment at: libcxx/include/utility:1635
+__to_underlying(_Tp __val) noexcept {
+  return static_cast<underlying_type_t<_Tp> >(__val);
+}
----------------
Since we also use bitmask types in C++11, would it be possible to make this available in C++11? `std::underlying_type` is available in C++11.


================
Comment at: libcxx/utils/generate_feature_test_macro_components.py:599
+    "name": "__cpp_lib_to_underlying",
+    "values": { "c++2b": 202102 },
+    "headers": ["utility"],
----------------
curdeius wrote:
> curdeius wrote:
> > Mordante wrote:
> > > The paper has no number. Is it certain this will be the final value?
> > I'll wait for the draft to be updated before committing I think to confirm the value.
> I'm pretty sure it will be the final value, since another feature approved in the same meeting uses this value. Cf. https://github.com/cplusplus/draft/pull/4515/files#diff-f46371f476893d323cfcb1383e9a70f07ff1c1f0c217e22294d0bf937aae6794R696.
Sounds good enough to me. If it's wrong it's also trivial to fix.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97365



More information about the libcxx-commits mailing list