【发布时间】:2021-03-13 03:07:24
【问题描述】:
我开始熟悉使用向量(阅读An introduction to std::vector),它显示以下代码作为示例:
// as with std::array, the type can be omitted since C++17
std::vector array4 { 9, 7, 5, 3, 1 }; // deduced to std::vector<int>
如果我将这种 C++17 样式的向量初始化与字符串文字一起使用,向量将推导出什么类型(即std::string、char* 等)?
std::vector strArray {"Hello", "world", "!!!"};
【问题讨论】:
标签: c++ string vector type-deduction