字符串的这种初始化std::array
失败:
const std::array<std::string, 1> str_array {"Text"};
来自 gcc 5.1.1 的错误消息是:
error: array must be initialized with a brace-enclosed initializer
编辑:这种形式的初始化也失败了:
const std::array<std::string, 1> str_array = {"Text"};
编辑2:只有这种形式有效:
const std::array<std::string, 1> str_array {{"Text"}};