basic_string
to basic_string_view
Section: 27.3.3 [string.view.template] Status: NAD Submitter: Antony Polukhin Opened: 2018-02-19 Last modified: 2022-08-24
Priority: 2
View all other issues in [string.view.template].
View all issues with NAD status.
Discussion:
It is known that we cannot disable move construction of
basic_string_view
from rvalues of basic_string
, because it breaks a
valid use case:
string foo(); void bar(string_view ); bar(foo());
Though it is still possible to disable an absolutely wrong case of
assigning an rvalue basic_string
to basic_string_view
:
string_view sw = "Hello"; sw = foo();
Some tests that make sure that other use cases are not affected are available here
[2018-06-18 after reflector discussion]
Priority set to 2; status to LEWG
[2020-05-28; LEWG issue reviewing]
LEWG issue processing voted to reject 3068 as NAD. Status change to Open.
SF F N A SA 15 5 1 0 0
[2022-08-24 Status changed: Open → NAD.]
LWG telecon: close based on LEWG direction. "This makes string_view depend on basic_string." "Request a paper with implementation if someone really wants this."
Proposed resolution:
This wording is relative to N4727.
Change 27.3.3 [string.view.template], class template basic_string_view
synopsis,
as indicated:
[…] // 27.3.3.2 [string.view.cons], construction and assignment constexpr basic_string_view() noexcept; constexpr basic_string_view(const basic_string_view&) noexcept = default; constexpr basic_string_view& operator=(const basic_string_view&) noexcept = default; template <class A> basic_string_view& operator=(const basic_string<charT, traits, A>&&) = delete; constexpr basic_string_view(const charT* str); constexpr basic_string_view(const charT* str, size_type len); […]