[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
Sat Nov 19 14:16:27 PST 2022
ldionne added inline comments.
================
Comment at: libcxx/include/__string/char_traits.h:55
+
+ static _LIBCPP_CONSTEXPR_SINCE_CXX17 void assign(char_type&, const char_type&) _NOEXCEPT;
+ static _LIBCPP_CONSTEXPR bool eq(char_type, char_type) _NOEXCEPT;
----------------
philnik wrote:
> These don't have to be marked `constexpr` or `noexcept` for user-provided ones. It's probably also just noise for most people.
I think you're right.
================
Comment at: libcxx/test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp:27
+ template <>
+ struct char_traits<VeryLarge> {
+ using char_type = VeryLarge;
----------------
philnik wrote:
> I'd rather avoid opening the `std` namespace and instead use `template<> struct std::char_traits<VeryLarge>`.
I don't think that's valid in C++03. GCC gives an error and requires using `-fpermissive`.
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