Section: 24.4.2 [string.view.template] Status: New Submitter: Antony Polukhin Opened: 2017-03-01 Last modified: 2017-11-13
View all issues with New status.
Force the literal type requirement for the const_iterator in the std::basic_string_view so that iterators of std::basic_string_view could be used in constexpr functions.
Wording tweaks suggested by LWG applied.
[2017-03-02, Tim Song comments]
I don't believe the blanket "all operations" wording is quite correct.First, T t; (required by DefaultConstructible) isn't usable in a constant expression if the iterator is a pointer, since it would leave it uninitialized. Second, an explicit destructor call u.~T() (required by Destructible) isn't usable if the iterator is a class type because it explicitly invokes a non-constexpr function (the destructor); see [expr.const]/2.2.
Set priority to 2. Lisa and Alisdair to work with Antony to come up with better wording. The same wording can be used for 2897.
[2017-11 Albuquerque Saturday issues processing]
P0858R0 (adopted on Sat; to be moved in Jacksonville) will resolve this.
This wording is relative to N4640.
Add to the end of the 24.4.2 [string.view.template] section:
-1- In every specialization basic_string_view<charT, traits>, the type traits shall satisfy the character traits requirements (21.2), and the type traits::char_type shall name the same type as charT.