course icon indicating copy to clipboard operation
course copied to clipboard

报错:no suitable user-defined conversion from "CudaAllocator<int>" to "CudaAllocator<std::_Container_proxy>" exists

Open anzisheng opened this issue 2 years ago • 3 comments

在08课程04_sugar\01下面生成 visual studio 2022 项目之后,运行报错如下: “no suitable user-defined conversion from "CudaAllocator" to "CudaAllocatorstd::_Container_proxy" exists”,请问老师如何修改?

anzisheng avatar Aug 30 '23 03:08 anzisheng

已经修复 https://github.com/parallel101/course/blob/master/08/include/CudaAllocator.h#L28C1-L34C6

archibate avatar Aug 31 '23 01:08 archibate

    template <class U> // cihou shabi wendous
    constexpr CudaAllocator(CudaAllocator<U> const &other) noexcept {
    }

    constexpr bool operator==(CudaAllocator<T> const &other) const {
        return this == &other;
    }

archibate avatar Aug 31 '23 01:08 archibate

@archibate 小彭老师,我试验了一下,好像没有效果,仍然保一样的错。

anzisheng avatar Aug 31 '23 02:08 anzisheng