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

后端 未结 4 1063
既然无缘
既然无缘 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:04

    This page documenting the class explicitely indicates that the specialization does not provide this method.

    The specialization has the same member functions as the unspecialized vector, except data, emplace, and emplace_back, that are not present in this specialization.

    This other page as well as §23.3.7 of the C++ specifications do confirm it.

提交回复
热议问题