Open
Description
Can we have a string type which doesn't make a deep copy? It could be a big performance boost when we serialize some big Data Transfer Object
to json. For example:
const std::string s = make_some_string();
json::object res;
res.emplace("value", json::string_ref(s.c_str())); // string_ref or any name you like
// ...
return json::serialize(res);
Rapidxml already has simillar distinction between owning and non-owning strings:
https://rapidjson.org/md_doc_tutorial.html#CreateString
https://rapidjson.org/structrapidjson_1_1_generic_string_ref.html