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: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 05 Feb 2026 08:55:23 -0800
On Thursday, 5 February 2026 00:10:58 Pacific Standard Time Sebastian Wittmeier
via Std-Proposals wrote:
> -> Don't calculate the length, if not needed. Only do it at first use.
> Should be as efficient as a char* pointer (at least regarding the
> operations).

Do note one extra benefit of only wrapping a char *: it can be used to replace
argv[] in main() without memory allocation.

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

Received on 2026-02-05 16:55:35