저는 스마트 포인터가 생소하고 모든 걸림돌을 치고 있습니다. 나는 시도하고이 줄을 사용하여이 구조체의 shared_ptr
을 할 때shared_ptr을 생성하는 중 문제가 발생했습니다.
struct texture_t
{
hash32_t hash;
uint32_t width;
uint32_t height;
uint32_t handle;
};
:
error C2664: 'mandala::texture_t::texture_t(const mandala::texture_t &)' : cannot convert parameter 1 from 'mandala::texture_t *' to 'const mandala::texture_t &'
:이 오류가
auto texture_shared_ptr = std::make_shared<texture_t>(new texture_t());
을
나는 구조체 texture_t
이 이 오류는 어디서 발생하며 어떻게 피할 수 있습니까?
매력처럼 작동합니다. 감사합니다. 이게 내가 생각한 것보다 똑똑한 것 같아! –