简体   繁体   English

如何 std::move 一个 boost::multi_array?

[英]How to std::move a boost::multi_array?

It doesn't appear that multi_array has a move constructor - is this correct? multi_array似乎没有移动构造函数 - 这是正确的吗? Is there a reason for this or was it just never implemented since the class seems to have been written before move semantics were available?这是有原因的还是只是从未实现过,因为该类似乎是在移动语义可用之前编写的? Is there anything to be done about this in user land?在用户领域有什么可以做的吗?

Boost.MultiArray does not support move construction (or move assignment). Boost.MultiArray 不支持移动构造(或移动赋值)。 The only copy constructor is the one in line 229 in boost/multi_array.hpp .唯一的复制构造函数是boost/multi_array.hpp中第 229 行的构造函数。

  multi_array(const multi_array& rhs);

(Among other reasons that's why I implemented my own array library: https://godbolt.org/z/M1bWGj8YW ) (这就是我实现自己的数组库的其他原因: https ://godbolt.org/z/M1bWGj8YW)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM