[libcxx-commits] [PATCH] D131322: [libc++] Fixes string_view comparison operators.

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 8 10:14:43 PDT 2022


philnik accepted this revision.
philnik added a comment.
This revision is now accepted and ready to land.

LGTM % nit.



================
Comment at: libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp:12
+// During the review D130295 it was noticed libc++'s implementation uses
+// std::common_type. When uses specialize this template for their own types the
+// comparisions would fail. This tests with a specialized std::common_type.
----------------



================
Comment at: libcxx/test/std/strings/string.view/string.view.comparison/common_type_specialization.pass.cpp:35
+
+  static size_t length(const char_wrapper* a) { return std::strlen(reinterpret_cast<const char*>(a)); }
+
----------------
You didn't have to keep my quick-n-diry implementation, but I guess it should be fine. Maybe add a `static_assert(sizeof(char_wrapper) == 1)` for my sanity? Unless it's guaranteed by the standard. In that case I'd be interested where that is guaranteed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131322



More information about the libcxx-commits mailing list