std::vector::data() 的状态是什么? [英] What's the status of std::vector::data()?

查看:56
本文介绍了std::vector::data() 的状态是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚意识到我一直在使用 std::vector::data() 出于与 std::string 的相似性,但一位同事指出它不是标准的.

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.

显然 Gcc 实现了它,但是查看它的包含文件,我发现了以下评论:

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

我的问题是:

  • 此方法是否已被其他编译器广泛实现?
  • 它是否包含在 C++0x 中?

(我也想知道 DR 464 是什么,以及 _GLIBCXX_RESOLVE_LIB_DEFECTS,但我不妨再问一个问题).

(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).

推荐答案

我无法评论当前的编译器实现,但通过查看 c++0x 标准 n3290.pdf,它列在 23.3.6.4.

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.

这篇关于std::vector::data() 的状态是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆