提升元组和 stl 向量编译错误
Boost tuple and stl vector compilation error
以下行不会编译错误:
No viable overloaded '='
std::string myString;
float myFloat;
boost::tuple<const std::string&, float> myTuple
= boost::tuple<const std::string&, float>(myString, myFloat);
std::vector<boost::tuple<const std::string&, float> > myVector;
myVector.push_back(myTuple);
有人有线索吗!?提示:如果我用一个简单的标准::字符串替换"const std::string&",一切都很好。
向量的成员必须是可复制的(C++98)或至少是可移动的(C++11)。引用不是。
相关文章:
- 将编译时常量向量转换为堆分配版本
- 如何实现使用 gcc-4.4 编译的大向量初始化?
- 索引 2D 向量时'Reference to type const..'编译错误
- 尝试初始化结构向量时出现编译错误
- C++向量迭代器nth_element编译错误
- 在编译时以增量方式构建变量指针的向量
- 向量迭代编译为非常不同的指令
- 编译错误向量排序和联合
- 模板函数,它使用 n_copy 复制前 n 个元素形成一个向量,另一个向量导致编译错误
- 使用GCC v4.8在Ubuntu 14.04上定义C 11中元组向量时的编译错误
- 返回向量<对<字符串,字符串>>会导致 gcc 编译代码 (curlcpp) 崩溃
- 使用带有初始值设定项列表的 Stroustrup PPP 书中的向量时出现编译错误
- 在向量中使用派生的可移动但不可压缩的会导致编译错误
- 将指针指向函数的函数和将默认值作为参数的向量会导致编译错误
- 在编译时使用模板初始化指向数组的指针的常量向量
- 常量引用向量向量<向量<long>>赋值不编译
- 使用 Agner 的向量类库编译多架构代码
- C++在编译时将图像像素嵌入向量中
- 提升元组和 stl 向量编译错误
- 无法为指针向量编译比较函数