Is it reasonable to use std::basic_string as a contiguous buffer when targeting C++03?

前端 未结 5 493
挽巷
挽巷 2020-11-27 06:59

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

5条回答
  •  臣服心动
    2020-11-27 07:40

    Of course, allocating a vector here is silly. Using std::wstring here is not wise also. It's better to use a char array to call the winapi. construct a wstring when returning value.

提交回复
热议问题