[英]instantiating struct with boost multi_array
I have a struct that extends an abstract class and then I add a boost multi_array inside as variable, I get the following error. 我有一个扩展抽象类的结构,然后在内部添加一个boost multi_array作为变量,出现以下错误。
struct myrunnablestruct : zi::runnable{
boost::multi_array<int,3> myArray;
myrunnablestruct(unsigned int dimensions )
: myArray( boost::extents[ dimensions ][ dimensions ][ dimensions ] )
{ }
}
int main(){
myrunnablestruct mrs(8);
}
error: cannot declare variable '
mrs
' to be of abstract type because the following virtual functions are pure withinzi::concurrency::runnable
错误:无法将变量'mrs
'声明为抽象类型,因为以下虚拟函数在zi::concurrency::runnable
是纯净的
The error is unreleated to boost::multi_array<>
. 错误不会释放给boost::multi_array<>
。
zi::runnable
has pure virtual member function(s), which your struct does not implement, and it is impossible to instantiate a type with pure virtual member functions. zi::runnable
具有纯虚拟成员函数,您的结构未实现,因此无法使用纯虚拟成员函数实例化类型。 Presumably the error message tells you exactly which member functions you need to implement, but you didn't paste that part of the error message in your question. 大概该错误消息会告诉您确切需要实现哪些成员函数,但是您并未将错误消息的该部分粘贴到您的问题中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.