We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The compute vector assigns another compute vector.
A const-correctness error is thrown, when assigning a compute vector to another compute vector.
As suggested by @K-ballo: vector::op= should be copying over other.alloc and operating with that instead
A quick fix working for me is:
vector& operator=(vector const& other) { if (this == &other) return *this; allocator_type tmpAlloc = other.alloc_; pointer data = alloc_traits::allocate(tmpAlloc, other.capacity_); hpx::parallel::util::copy(other.begin(), other.end(), iterator(data, 0, alloc_traits::target(tmpAlloc))); if (data_ != nullptr) { alloc_traits::bulk_destroy(alloc_, data_, size_); alloc_traits::deallocate(alloc_, data_, capacity_); } size_ = other.size_; capacity_ = other.capacity_; alloc_ = other.alloc_; data_ = std::move(data); return *this; }
The text was updated successfully, but these errors were encountered:
@PrimeF Thanks for reporting! Would you mind creating a PR for this?
Sorry, something went wrong.
Sure, I will do one!
No branches or pull requests
Expected Behavior
The compute vector assigns another compute vector.
Actual Behavior
A const-correctness error is thrown, when assigning a compute vector to another compute vector.
Steps to Reproduce the Problem
Specifications
Fix suggestions
As suggested by @K-ballo: vector::op= should be copying over other.alloc and operating with that instead
A quick fix working for me is:
The text was updated successfully, but these errors were encountered: