C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Generic code, not the API you are looking for

From: Zhihao Yuan <zy_at_[hidden]>
Date: Mon, 22 Aug 2022 02:30:11 +0000
On Sunday, August 21st, 2022 at 2:17 PM, Thiago Macieira via Std-Proposals <std-proposals_at_[hidden]> wrote:


> On Sunday, 21 August 2022 04:11:27 -03 Zhihao Yuan via Std-Proposals wrote:
> > [...] builds like normal code.
>

> Please take this one step further. How does that compile to normal code when
> the size of the character type isn't known at compile time?
>


Ask the users to specify like Rust did,
or -- it's actually possible to compile
such code if the String protocol doesn't
operate char by value. std::string almost
does not do that. The more interesting
question is whether and how to design
existential containers that encapsulate
value semantics or provide a framework
to enable this possibility.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
_______________________________________________

Received on 2022-08-22 02:30:20