With augmented interface, operations requiring an input string are implemented as a single overload with a parameter of type <<ref_string_view>>, and can accept most string-like objects. Objects such as null terminated character pointers, `std::string`, <<ref_string>>, subranges of strings, and objects convertible to <<ref_string_view>> can all be passed to these functions.
This design removes several redundant overloads from the interface. For example, the 11 overloads of `std::string::insert` are reduced to just 3 in <<ref_string>>, while still providing identical functionality. In addition to these changes, overloads taking a `std::initializer_list<char>` parameter have been removed. Such overloads have little use, as they serve as little more than wrappers for arrays with an inefficient syntax:
With the removal of overloads that specify parameters for a substring, a member function `subview` that returns a <<ref_string_view>> is provided to facilitate cheap substring operations:
A <<ref_string>> may be constructed using the <<default_memory_resource,default memory resource>> without incurring any memory allocations. Alternatively, a <<ref_storage_ptr>> can be provided explicitly:
When a <<ref_string>> is formatted to a {std_ostream}, the result is a valid JSON. That is, the result will be double quoted and the contents properly escaped per the JSON specification.
<<ref_string>> directly supports access to its storage in the range `[size(), capacity())`. This can be used for efficient assembly of a string from several parts. After the string is assembled, use the member function <<ref_string_grow>> to update the string's size and insert the null terminator. For example: