Subject: Re: [std-proposals] Avoid copies when using string_view with APIs expecting null terminated strings
From: Arthur O'Dwyer (arthur.j.odwyer_at_[hidden])
Date: 2020-12-26 16:06:25
On Sat, Dec 26, 2020, 3:03 PM Thiago Macieira via Std-Proposals <
> On Saturday, 26 December 2020 03:38:20 -03 Tony V E via Std-Proposals
> > An implementation can probably hide the âbool inside an unused bit of the
> > pointer (or length),
A third option is to use one of the unused bits in the pointer on CPUs that
> support address masking / colouring.
Storing in the integer length: almost certainly okay.
Storing in the pointer: almost certainly not okay, unless I have failed to
keep up with C++20 constexpr rules. string_view is specified to be
constexpr-friendly in C++17 and later. That means no type-punning.
STD-PROPOSALS list run by email@example.com
Standard Proposals Archives on Google Groups