Class
parsers::json::String
A decoded (un-escaped) JSON string token, storing its characters either owned (String<std::string>) or as a zero-copy view (String<std::string_view>), chosen by the storage type S via the deduction guides below.
Template parameters
S | the backing storage: std::string (owning) or std::string_view (viewing). |
Functions
Construct from the backing storage.
Owning S=std::string moves the rvalue in; viewing S=std::string_view just stores the (cheap) view — the characters are never copied here.
Parameters
value | the string storage (moved in). |
Complexity
O(1) — a std::string move or a std::string_view copy; characters are never copied.
Allocation
none.
Read the characters uniformly as a view, whether owning or viewing (no setter).
Returns
a std::string_view over the stored characters.
Complexity
O(1).
Allocation
none.
