json icon indicating copy to clipboard operation
json copied to clipboard

string::resize_and_overwrite

Open vinniefalco opened this issue 3 years ago • 7 comments

We should add string::resize_and_overwrite as per P1072R10 (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1072r10.html). The function serialize_impl can be changed to use it.

vinniefalco avatar Jan 12 '22 16:01 vinniefalco

I guess we would want to deprecate string::grow

vinniefalco avatar Jan 12 '22 16:01 vinniefalco

You mean, alternative implementation when C++23 is supported?

grisumbras avatar Jan 15 '22 14:01 grisumbras

add it to json::string

vinniefalco avatar Jan 15 '22 15:01 vinniefalco

But how would serialize_impl use it? It doesn't use json::string.

grisumbras avatar Jan 15 '22 15:01 grisumbras

I thought there was an overload the serialized to json::string?

vinniefalco avatar Jan 15 '22 15:01 vinniefalco

This doesn't seem to be the case.

grisumbras avatar Jan 15 '22 15:01 grisumbras

We could add it. Anyway json::string::resize_and_overwrite is a better API than the current json::string::grow

vinniefalco avatar Jan 15 '22 15:01 vinniefalco