小编use*_*851的帖子

负尺寸数组没有错误

为什么我在尝试创建负大小的数组时出错?

#include <array>

int main()
{
    std::array<int, -1> arr;
}
Run Code Online (Sandbox Code Playgroud)

随着-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC我没有得到任何错误.这是预期的行为吗?

c++ arrays c++11 stdarray

13
推荐指数
2
解决办法
1555
查看次数

标签 统计

arrays ×1

c++ ×1

c++11 ×1

stdarray ×1