Is it reasonable to use std::basic_string<t> as a contiguous buffer when targeting C++03?
问题 I know that in C++03, technically the std::basic_string template is not required to have contiguous memory. However, I\'m curious how many implementations exist for modern compilers that actually take advantage of this freedom. For example, if one wants to use basic_string to receive the results of some C API (like the example below), it seems silly to allocate a vector just to turn it into a string immediately. Example: DWORD valueLength = 0; DWORD type; LONG errorCheck = RegQueryValueExW(