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

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 6 12:23:53 PDT 2021


Mordante added a comment.

For now I only wanted to comment on the unsigned conversion. ATM I don't have time for a proper review.



================
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);
+}
----------------
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.


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