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: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Mon, 2 Feb 2026 00:02:45 +0000
On Sun, Feb 1, 2026 at 11:46 PM, I wrote:
>
> class TermString final {
> using size_t = std::size_t;
> char *const p;
> char const saved = '\0';


Actually on a lot of platforms I can store the "saved byte" in the top
8 bits of the pointer (e.g. 64-Bit pointer on x86_64 only needs 48
bits).

Received on 2026-02-02 00:01:36