[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
Wed Nov 23 08:58:12 PST 2022
ldionne added a comment.
In D138307#3946939 <https://reviews.llvm.org/D138307#3946939>, @ldionne wrote:
> In D138307#3946938 <https://reviews.llvm.org/D138307#3946938>, @jyknight wrote:
>
>> This breaks Apache Arrow, which makes a basic_string_view<unsigned long>, here:
>> https://github.com/apache/arrow/blob/91ee6dad722ee154d63eea86ce5644e1e658b53b/cpp/src/arrow/util/bitmap.h#L53
>>
>> [...]
>>
>> Also breaks v8, which uses a std::basic_string<uint16_t> member, https://github.com/v8/v8/blob/0afe3f519821449f00c746df3747543d3458bb68/src/inspector/string-16.h#L113
>
> That is intended, they should fix their usage of `std::string`. If they really want to use `std::string` for these "character types", then they can define `struct MyChar { unsigned long c_; };` and then specialize `std::char_traits<MyChar>`.
One thing we could do is instead deprecate the whole base template (but still provide an implementation) so as to give folks two releases to get off of it. I'm pretty skeptical about `std::string` working as intended for `unsigned long`, but whatever. @tahonermann What would you think about 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