Closed pengweichu closed 1 year ago
I can't get it compiled with the below code:
std::vector<std::unique_ptr<MyClass>> data; BlockingConcurrentqueue<std::unique_ptr<MyClass>, Traits> q; auto size = data.size(); q.enqueue_bulk(data.begin(), size); // not ok q.enqueue_bulk(std::move(data.begin()), size); // not ok
How can I get it compiled ?
Thanks
unique_ptr can only be moved, not copied. Try:
unique_ptr
q.enqueue_bulk(std::make_move_iterator(data.begin()), size);
Solved, thanks.
I can't get it compiled with the below code:
How can I get it compiled ?
Thanks