We can use append() instead of data(). This allows the size of the
string view instance to be used directly instead of redundantly doing a
string size lookup.
In some implementations, returning via default construction for
std::optional can cause the entire inner buffer to be zeroed out.
Returning with std::nullopt causes only the internal validity flag to be
set and nothing more.
Includes all necessary headers and uses a forward declaration where
applicable. Ensures inclusion changes in other headers don't break the compilation
of these headers and source files.
Makes use of the C++14 make_unique allocation function to allocate class
instances where applicable instead of a reset with a new operator within
it.
This doesn't touch cases where buffers are allocated, given make_unique
would zero-initialize them.