diff --git a/src/care/host_device_ptr.h b/src/care/host_device_ptr.h index 7459c13a..94ff10f2 100644 --- a/src/care/host_device_ptr.h +++ b/src/care/host_device_ptr.h @@ -21,6 +21,7 @@ #include "chai/ManagedArray.hpp" // Std library headers +#include #include @@ -93,9 +94,16 @@ namespace care { /// /// @author Peter Robinson /// - /// nullptr constructor + /// Construct from nullptr /// - CARE_HOST_DEVICE host_device_ptr(std::nullptr_t from) noexcept : MA (from) {} + /// @note The constraint prevents overload ambiguity between this + /// constructor and the size_t constructor when constructing + /// with the integer literal 0. Additionally, the constraint + /// is a workaround for a nvcc bug where overload resolution + /// can incorrectly report an ambiguity between this constructor + /// and the size_t constructor. + /// + CARE_HOST_DEVICE host_device_ptr(std::same_as auto from) noexcept : MA (from) {} /// /// Construct from a size