[libcxx-commits] [PATCH] D102006: [libcxx][ranges] Add range.subrange.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue May 11 11:21:11 PDT 2021


zoecarver added a comment.

This is ready for review now.



================
Comment at: libcxx/include/type_traits:2311-2314
+template<class _From>
+[[nodiscard]] constexpr auto __to_unsigned_like(_From __x) noexcept {
+  return static_cast<make_unsigned_t<_From>>(__x);
+}
----------------
Mordante wrote:
> cjdb wrote:
> > Mordante wrote:
> > > cjdb wrote:
> > > > I wanna poach this for D101922. WDYT?
> > > I would like `_LIBCPP_INLINE_VISIBILITY` and I dislike the `_like` suffix. Of course if we remove the `_like` it duplicates `__to_unsigned` defined in `<charconv>`. I start to feel it makes sense to make a header to do some of these signed to unsigned conversions. (I also use them for `<format>` but there I already require `<charconv>`. WDYT? (Note `<charconv>` is available in C++11 as an extension.)
> > > I wouldn't mind to put up a review to make this change.
> > This is already in main. I'm not sure why it's showing up in the diff.
> I see thanks. Any objection to renaming it to `__to_unsigned`? Since `<charconv>` already depends on `<type_traits>` I'll make a patch to let `<charconv>` reuse this function.
> I see thanks. Any objection to renaming it to __to_unsigned? Since <charconv> already depends on <type_traits> I'll make a patch to let <charconv> reuse this function.

That would be great, thanks @Mordante.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102006



More information about the libcxx-commits mailing list