[libcxx-commits] [PATCH] D138307: [libc++] Remove default definition of std::char_traits

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 22 09:13:01 PST 2022


ldionne marked an inline comment as done.
ldionne added inline comments.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.lazy.split/general.pass.cpp:36-42
+  constexpr BasicSmallString(std::basic_string_view<char> v) : buffer_(v.begin(), v.end()) {}
+#ifndef TEST_HAS_NO_WIDE_CHARACTERS
+  constexpr BasicSmallString(std::basic_string_view<wchar_t> v) : buffer_(v.begin(), v.end()) {}
+#endif
+  constexpr BasicSmallString(std::basic_string_view<char8_t> v) : buffer_(v.begin(), v.end()) {}
+  constexpr BasicSmallString(std::basic_string_view<char16_t> v) : buffer_(v.begin(), v.end()) {}
+  constexpr BasicSmallString(std::basic_string_view<char32_t> v) : buffer_(v.begin(), v.end()) {}
----------------
tahonermann wrote:
> Is the intent really to support conversions from ranges of different character types? That seems odd and doesn't seem to be required by the test.
No, you're right. Thanks for the catch, I'll fix that.

The intent is to be constructible from a `string_view` (specifically we need to be constructible from a null-terminated C-style string) whenever `Char` is one of these types, and my change here was a really sloppy way of doing that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138307



More information about the libcxx-commits mailing list