[libc++] LWG 3857: allow `string_view` conversion when only traits vary
authorJoe Loser <joeloser@fastmail.com>
Tue, 14 Feb 2023 03:16:50 +0000 (20:16 -0700)
committerJoe Loser <joeloser@fastmail.com>
Thu, 16 Feb 2023 13:00:01 +0000 (06:00 -0700)
commit83014d877017a796f89e4bb81347132619731bf9
tree99b904e92238ab7479235a757be51a167c97cbeb
parent574e417460cdfebb8157fbe61b6a015e44856f64
[libc++] LWG 3857: allow `string_view` conversion when only traits vary

The `basic_string_view` constructor accepting a contiguous range rejects
converting between `basic_string_view` even when only the trait types vary.
This prevents conversions for converting from `basic_string_view<C, T1>` and
`basic_string<C, T1, A>` to `basic_string_view<C, T2>`.  Recently, this
constructor was made `explicit`, so there's no reason to really forbid this
conversion anymore.

Relax the restriction that the trait types need to match in this constructor.

Differential Revision: https://reviews.llvm.org/D143972
libcxx/docs/Status/Cxx2bIssues.csv
libcxx/include/string_view
libcxx/test/std/strings/string.view/string.view.cons/from_range.pass.cpp
libcxx/test/std/strings/string.view/string.view.cons/from_string1.compile.fail.cpp [deleted file]
libcxx/test/std/strings/string.view/string.view.cons/from_string2.compile.fail.cpp [deleted file]