gpt4 book ai didi

c++ - boost::Eigen::MatrixXf 的无锁队列

转载 作者:行者123 更新时间:2023-11-28 00:10:51 25 4
gpt4 key购买 nike

我正在尝试创建一个 boost::lockfree::queue 下面的例子:http://www.boost.org/doc/libs/1_54_0/doc/html/lockfree/examples.html

我可以为 int(整数数据类型)成功创建它。但是我很难为 Eigen::MatrixXf 创建队列。该队列在 SolveDGEM.h 中声明。

boost::lockfree::queue<Eigen::MatrixXf> q_cam0;

我收到以下我无法理解的编译器错误

In file included from /home/eeuser/ros_workspaces/HeloRosProject/src/visensor_dgem/include/SolveDGEM.h:38:0,
from /home/eeuser/ros_workspaces/HeloRosProject/src/visensor_dgem/src/dgem.cpp:4:
/usr/local/include/boost/lockfree/queue.hpp: In instantiation of ‘boost::lockfree::queue<Eigen::Matrix<float, -0x00000000000000001, -0x00000000000000001> >’:
/home/eeuser/ros_workspaces/HeloRosProject/src/visensor_dgem/include/SolveDGEM.h:76:45: instantiated from here
/usr/local/include/boost/lockfree/queue.hpp:86:1: error: invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE<false>’
/usr/local/include/boost/lockfree/queue.hpp: In instantiation of ‘boost::lockfree::queue<Eigen::Matrix<float, -0x00000000000000001, -0x00000000000000001> >’:
/home/eeuser/ros_workspaces/HeloRosProject/src/visensor_dgem/include/SolveDGEM.h:76:45: instantiated from here
/usr/local/include/boost/lockfree/queue.hpp:90:1: error: invalid application of ‘sizeof’ to incomplete type ‘boost::STATIC_ASSERTION_FAILURE<false>’

最佳答案

参见 http://www.boost.org/doc/libs/1_59_0/doc/html/boost/lockfree/queue.html :

T must have a trivial destructor

这对于 Eigen::MatrixXf 是不正确的。

关于c++ - boost::Eigen::MatrixXf 的无锁队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33208301/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com