64,654
社区成员
发帖
与我相关
我的任务
分享
//头文件
clase A
{
private:
static const std::vector<std::string> m_vec;
}
//源文件
const std::vector<std::string> A::m_vec = //我想初始化m_vec有3个不同的元素,比如:"one","two","three",这里怎么定义?
const std::vector<std::string> A::m_vec = {"one","two","three"};
char*x[]={"one","two","three"};
const std::vector<std::string> A::m_vec( x , x + 3 );