【发布时间】:2013-02-10 03:45:46
【问题描述】:
关于以下代码
std::array<int,3> myarray = {10,20,30};
我收到以下编译器警告
warning: missing braces around initializer for ‘std::array<int, 3u>::value_type [3] {aka int [3]}’ [-Wmissing-braces]
为什么?
工具链:(编辑)
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
【问题讨论】:
-
我们应该猜测您使用的是什么工具链吗?