Date: Mon, 24 Jan 2022 14:58:22 -0500
> On Jan 22, 2022, at 11:28 PM, Peter Dimov <pdimov_at_[hidden]> wrote:
>
> Tony V E wrote:
>> On Tue, Jan 18, 2022 at 1:40 PM Daveed Vandevoorde via SG7
>> <sg7_at_[hidden] <mailto:sg7_at_[hidden]> > wrote:
>>
>>
>>
>>
>> How about specifying that all string_view results from reflection
>> functions (there aren’t that many) have a null-terminated data()?
>> E,g,:
>>
>> auto len = std::strlen(name_of(^S).data()); // Okay and as intuitively
>> expected.
>>
>> Daveed
>>
>>
>>
>> Will this lead to invalid expectations regarding string_views? Sometimes strlen
>> works on string_views, sometimes it doesn't?
>
> Hence Barry's allusion to http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1402r0.pdf.
Oh, _that_’s what zstring_view referred to :-)
>
> I still have no idea why people object so strongly to it.
(I have no opinion in favor/against it, but it seems reasonable on the face of it.)
Daveed
>
> Tony V E wrote:
>> On Tue, Jan 18, 2022 at 1:40 PM Daveed Vandevoorde via SG7
>> <sg7_at_[hidden] <mailto:sg7_at_[hidden]> > wrote:
>>
>>
>>
>>
>> How about specifying that all string_view results from reflection
>> functions (there aren’t that many) have a null-terminated data()?
>> E,g,:
>>
>> auto len = std::strlen(name_of(^S).data()); // Okay and as intuitively
>> expected.
>>
>> Daveed
>>
>>
>>
>> Will this lead to invalid expectations regarding string_views? Sometimes strlen
>> works on string_views, sometimes it doesn't?
>
> Hence Barry's allusion to http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1402r0.pdf.
Oh, _that_’s what zstring_view referred to :-)
>
> I still have no idea why people object so strongly to it.
(I have no opinion in favor/against it, but it seems reasonable on the face of it.)
Daveed
Received on 2022-01-24 19:58:23