It doesn't appear that multi_array
has a move constructor - is this correct? 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?
Asked
Active
Viewed 478 times
5

David Doria
- 9,873
- 17
- 85
- 147
-
1Many boost libraries are not C++11 ready, it's true. You can assume it's outdated, if the move constructor is not deleted. – Tatsuyuki Ishi Mar 09 '17 at 14:53
-
1As a workaround, you can use multi_array_ref and raw storage (`unique_ptr
`) to implement a movable version with the same interface – sehe Mar 09 '17 at 15:23 -
Or try swapping it around via std::swap or the boost equivalent – OutOfBound Mar 09 '17 at 16:19
1 Answers
0
Boost.MultiArray does not support move construction (or move assignment). The only copy constructor is the one in line 229 in boost/multi_array.hpp
.
multi_array(const multi_array& rhs);
(Among other reasons that's why I implemented my own array library: https://godbolt.org/z/M1bWGj8YW)

alfC
- 14,261
- 4
- 67
- 118