diff --git a/src/cuda/api/detail/unique_span.hpp b/src/cuda/api/detail/unique_span.hpp index 65c0d5e0..8c30ed1b 100644 --- a/src/cuda/api/detail/unique_span.hpp +++ b/src/cuda/api/detail/unique_span.hpp @@ -143,7 +143,9 @@ class unique_span : public ::cuda::span { /// Exchange the pointer and deleter with another object. void swap(unique_span& other) noexcept { - ::std::swap(*this, other); + using ::std::swap; + swap(*this, other); + swap(deleter_, other.deleter_); } /** * Release ownership of the stored span