Is const int[2] trivially copyable?

与世无争的帅哥 提交于 2019-12-06 14:12:51

3.9[basic.types]/9 says

Scalar types, trivially copyable class types (Clause 9), arrays of such types, and cv-qualified versions of these types (3.9.3) are collectively called trivially copyable types

Your case is array of cv-qualified version of a scalar type.

Yes.

Scalar types and arrays of TriviallyCopiable objects are TriviallyCopiable as well. [1]

Also gcc reports it as trivially copiable. It seems a bug in VS2013.

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