是“阵列” c ++ 11标准下的关键字? [英] Is "array" a keyword under c++11 standards?

查看:130
本文介绍了是“阵列” c ++ 11标准下的关键字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用array作为标识符Codeblocks突出显示它像其他关键字。
我在
中搜索了为什么是array C / C ++中的保留字?



但答案已过时。

否,数组不是关键字。


$

b $ b

仍然有一个C ++ 11标准库类型: std :: array ,一个固定长度的数组容器。



C ++ 1y草稿:

  alignas continue friend register true 
alignof decltype goto reinterpret_cast try
asm默认如果返回typedef
auto delete inline short typeid
bool do int signed typename
break double long sizeof union
case dynamic_cast mutable static unsigned
catch else namespace static_assert using
char enum new static_cast virtual
char16_t explicit noexcept struct void
char32_t export nullptr switch volatile
class extern operator template wchar_t
const false private this while
constexpr float protected thread_local
const_cast for public throw

这些替代表示(其存在我不喜欢,这只是我)不是关键字,虽然仍然保留:

 和and_eq bitand bitor compl not 
not_eq或or_eq xor xor_eq

上下文关键字(覆盖控制,放在类中的函数声明的末尾(<$ c因为已经是关键字,所以未列出)

 最终覆盖


While using "array" as an identifier Codeblocks highlighted it like the other keywords. I searched it up in Why is "array" a reserved word in C/C++?

But the answers were outdated. If yes, how is it used ?

解决方案

No, array is not a keyword.

Still, there is a C++11 standard-library type: std::array, a fixed-length array container.

Here a list of the keywords from the C++1y draft:

alignas    continue     friend    register         true
alignof    decltype     goto      reinterpret_cast try
asm        default      if        return           typedef
auto       delete       inline    short            typeid
bool       do           int       signed           typename
break      double       long      sizeof           union
case       dynamic_cast mutable   static           unsigned
catch      else         namespace static_assert    using
char       enum         new       static_cast      virtual
char16_t   explicit     noexcept  struct           void
char32_t   export       nullptr   switch           volatile
class      extern       operator  template         wchar_t
const      false        private   this while
constexpr  float        protected thread_local
const_cast for          public    throw

These alternative representations (whose very existence I dislike, but that's just me) are not keywords though still reserved:

and    and_eq bitand bitor compl  not
not_eq or     or_eq  xor   xor_eq

Contextual keywords (override control, put at the end of the function declaration in a class (new not listed because already a keyword))

final   override

这篇关于是“阵列” c ++ 11标准下的关键字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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