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
The result is undefined and I would not do it. The cost of reading into a vector and then converting to a string is trivial in modern c++ heaps. VS the risk that your code will die in windows 9
also, doesnt that need a const_cast on &buffer[0]?