私はスマート ポインターは初めてで、すべてのつまずきにぶつかっている最中です。
私は構造体を持っていますtexture_t
:
struct texture_t
{
hash32_t hash;
uint32_t width;
uint32_t height;
uint32_t handle;
};
shared_ptr
この行を使用してこの構造体を作成しようとすると:
auto texture_shared_ptr = std::make_shared<texture_t>(new texture_t());
次のエラーが表示されます。
error C2664: 'mandala::texture_t::texture_t(const mandala::texture_t &)' : cannot convert parameter 1 from 'mandala::texture_t *' to 'const mandala::texture_t &'
このエラーはどこから来て、どうすれば回避できますか?