[libcxx-commits] [PATCH] D97365: [libc++] [C++2b] [P1682] Add to_underlying.
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Mar 5 21:34:01 PST 2021
zoecarver added inline comments.
================
Comment at: libcxx/include/utility:1632
+__to_underlying(_Tp __val) noexcept {
+ return static_cast<typename underlying_type<_Tp>::type>(__val);
+}
----------------
Mordante wrote:
> curdeius wrote:
> > zoecarver wrote:
> > > Nit: you could use `underlying_type_t` here.
> > I can't, it's C++14 onwards.
> >
> > ```
> > #if _LIBCPP_STD_VER > 11
> > template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
> > #endif
> > ```
> > Nit: you could use `underlying_type_t` here.
>
> I asked for C++11 support so I can use it in D97115.
Ah, thanks. Sorry, missed that.
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