相关疑难解决方法(0)

Q_DECLARE_METATYPE是一个boost :: multi_array

我试图使用Qt的信号和插槽机制传递一个表示为boost :: multi_array的多维数组.我尝试使用以下代码声明元类型:

Q_DECLARE_METATYPE(boost::multi_array<double, 2>)
Run Code Online (Sandbox Code Playgroud)

但是我得到以下编译错误(在MSVC 2015上):

path\to\project\metatypes.h(7): error C2976: 'boost::multi_array': too few template arguments
..\..\ml_project\boost-libs\include\boost/multi_array.hpp(111): note: see declaration of 'boost::multi_array'
path\to\project\metatypes.h(7): error C2332: 'enum': missing tag name
path\to\project\metatypes.h(7): error C2065: 'Defined': undeclared identifier
path\to\project\metatypes.h(7): error C2143: syntax error: missing '>' before ';'
path\to\project\metatypes.h(7): error C2059: syntax error: '>'
path\to\project\metatypes.h(7): error C2976: 'QMetaTypeId': too few template arguments
c:\qt\qt-everywhere-opensource-src-5.5.0\qtbase\include\qtcore\../../src/corelib/kernel/qmetatype.h(1576): note: see declaration of 'QMetaTypeId'
path\to\project\metatypes.h(7): error C2913: explicit specialization; 'QMetaTypeId' is not a specialization of a class template
..\..\ml_project\boost-libs\include\boost/multi_array.hpp(111): note: see …
Run Code Online (Sandbox Code Playgroud)

c++ qt boost

5
推荐指数
1
解决办法
372
查看次数

标签 统计

boost ×1

c++ ×1

qt ×1