Daily bit(e) of C++ | std::quoted
Daily bit(e) of C++ ♻️158, Handling stream insertion and extraction of quoted strings using C++14 std::quoted.
std::quoted is a C++14 utility that simplifies reading and writing quoted strings.
When used during stream insertion, it will surround the given string with quotes and escape any internal quotes.
When used during stream extraction, the extraction will read the entire quoted string, remove surrounding quotes (if any) and unescape internal quotes.
Both the "quote" and "escape" characters can be customized.