C++ Logo

std-proposals

Advanced search

Re: [std-proposals] [Idea] Null-terminated string view (c_str_view / c_wstr_view) – a simpler alternative/complement to zstring_view

From: Alejandro Colomar <une+cxx_std-proposals_at_[hidden]>
Date: Thu, 5 Feb 2026 01:15:09 +0100
On 2026-02-04T16:03:15-0800, Thiago Macieira via Std-Proposals wrote:
> On Wednesday, 4 February 2026 15:47:51 Pacific Standard Time Henry Miller via
> Std-Proposals wrote:
> > It is important that c/zstring_view have a length that indicates how many
> > bytes total can be written to, perhaps with a note that all bytes after the
> > first null are unspecified.
>
> Why? It's a view, you can't write to any bytes you get from it.
>
> If you want to modify, go back to the original object that holds the writable
> buffer, like std::string.

+1

>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Principal Engineer - Intel Data Center - Platform & Sys. Eng.



> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals


-- 
<https://www.alejandro-colomar.es>

Received on 2026-02-05 00:15:15