C++ Logo

sg16

Advanced search

Re: [isocpp-sg16] Agenda for the 2025-04-09 SG16 meeting

From: Nevin Liber <nevin_at_[hidden]>
Date: Wed, 9 Apr 2025 14:17:10 -0500
On Wed, Apr 9, 2025 at 1:18 PM Tom Honermann via SG16 <sg16_at_[hidden]>
wrote:

> Section 6.1 (zstring_view and string_view relation) of P3655R0
> <https://wg21.link/p3655r0#zstring_view-and-string_view-relation>
> concludes that std::zstring_view can't be implemented in terms of
> std::string_view. I'm not yet convinced that is correct though.
>

Me neither. In section 6.1 I don't quite understand how: "there can not be
an inheritance relation between the two" follows from "in particular it is
not well-formed to use string_view's operator= to assign a
non-null-terminated string_view to a zstring_view". If we use inheritance,
assigning a zstring_view from a string_view doesn't compile anyway when we
default operator=. I'm not seeing the problem here.

There may be other reasons not to use inheritance, but this doesn't seem
like one of them.
-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden] <nevin_at_[hidden]>>
+1-847-691-1404

Received on 2025-04-09 19:17:50