What's the status of std::vector::data()?

↘锁芯ラ 提交于 2019-12-11 03:38:55

问题


I just realized that I've been using std::vector::data() out of similarity with std::string, but a colleague pointed out that it's not standard.

Apparently Gcc implements it, but looking at its include files, I found this comment:

  // _GLIBCXX_RESOLVE_LIB_DEFECTS
  // DR 464. Suggestion for new member functions in standard containers.
  // data access

My questions are:

  • is this method widely implemented by other compilers?
  • is it included in C++0x?

(I also wonder what DR 464 is, and also _GLIBCXX_RESOLVE_LIB_DEFECTS for that matter, but I might as well ask another question for those).


回答1:


I can't comment on current compiler implementations but by looking at the c++0x standard n3290.pdf it is listed at 23.3.6.4.



来源:https://stackoverflow.com/questions/6212572/whats-the-status-of-stdvectordata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!