What happens when you call data() on a std::vector?

后端 未结 4 1061
既然无缘
既然无缘 2020-12-01 23:39

C++11 has implemented data() member function on std::vector, which gives you a pointer to the memory array. Does this mean the template specializat

4条回答
  •  無奈伤痛
    2020-12-02 00:10

    It won't compile, unless your implementation has a non-standard extension. The specialisation of std::vector, as specified in C++11 23.3.7/1, doesn't declare a data member.

提交回复
热议问题