How to correctly add a null-terminated character for string\wstring strings from the standard library?

The task is to compare the representation of a wstring string with a vector of bytes, which contains the representation of this string + a null-terminated symbol. What to do, cut the last byte from the vector?

    1 answer 1

    There is no need to add a terminator, because the type ( std::basic_string<CharT> ) stores data about the length of a string and abstracts the user from its internal structure.