C++ "vector of vectors"
C++ "vector of vectors"
我必须创建一个包含Eigen::Vector2d
向量的std::vector
。我是这样声明的:
std::vector< std::vector< Eigen::Vector2d > > markingsPointSets;
我试着把我创建的一些元素推回去,像这样:
Eigen::Vector2d firstMarkingPoint(markingPointA[0] + AB_perp[0] * .15, markingPointA[1] + AB_perp[1] * .15); // Don't mind to the value of this variable :p
markingsPointSets.at(i).push_back(firstMarkingPoint);
但是这给了我:
error c2719 formal parameter with __declspec(align('16')) won't be aligned
请告诉我是否有遗漏的信息,以便找到问题的根源。
您可能没有阅读文档:
在固定大小的可向量化特征类型或具有此类类型成员的类上使用STL容器需要执行以下两个步骤:
必须使用16字节对齐的分配器。Eigen提供了一个可用的aligned_allocator。
如果你想使用
std::vector
容器,你需要#include这些问题只出现在固定大小的可向量化特征类型和具有这样的特征对象作为成员的结构中。对于其他特征类型,如Vector3f或MatrixXd,在使用STL容器时不需要特别注意。
(强调我的)
相关文章:
- Usages of std::move
- Codecademy - Vectors: Operations
- 使用 [] 运算符时"binding reference of type discards qualifiers"
- 如何处理 c++ 中类实现中的"invalid use of non-static data member"?
- 具有变量Number of Arguments的std::函数的矢量
- Capacity of a deque
- Deprecation of _writeBarrier()
- constexpr begin of a std::array
- 如何调整 std::vector of Eigen::MatrixXd 的大小
- C++ "error: invalid use of void expression"
- 我看到"use of undeclared identifier"错误,有人可以告诉我如何解决它吗?
- 赛通"Cannot take address of memoryview slice"
- 迭代一个巨大的 std::vector of std::vectors 并修改元素
- std::vector of std::vectors contiguity
- Vectors of lock_guards
- "a list of vectors of ints" - 这可能吗?
- Array of Vectors C++
- 简单的模板化函数,用于转换 std::vectors - "illegal use of this type as an expression"
- 哪个更快? "vector of structs"还是"a number of vectors"?
- C++ "vector of vectors"