Does std::string need to store its character in a contiguous piece of memory?

前端 未结 3 1786
轻奢々
轻奢々 2020-12-11 14:35

I know that in C++98, neither std::basic_string<> nor std::vector<> were required to use contiguous storage. This was seen as an oversi

3条回答
  •  囚心锁ツ
    2020-12-11 15:11

    According to the draft standard N4527 21.4/3 Class template basic_string [basic.string] :

    A basic_string is a contiguous container (23.2.1).

提交回复
热议问题