-
-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Description
Hi,
I notice that cuda::unique_span does not compile with C++20 (and I suppose it is also the case with older standards too)
The issue comes from the move assignment operator:
unique_span& operator=(unique_span&& other) noexcept
{
span_type released = other.release();
if (data() != nullptr) {
deleter_type{}(data());
}
data() = released.data();
size() = released.size();
}std::span data & size returns values, not references thus it is not possible to reassign them. I think what you did in the destructor is the correct approach.
unique_span& operator=(unique_span&& other) noexcept
{
span_type released = other.release();
if (data() != nullptr) {
deleter_type{}(data());
}
static_cast<span_type&>(*this) = released;
}Thanks a lot for all the efforts you put in this project.