I have a tiny piece of code which is throwing a lot of errors relating to accessing a deleted function, which I read is because of trying to give more than one owner to a unique_ptr, which is not allowed. However, I’m not aware how this code is doing that, so that reasoning doesn’t make sense to me. Then again, I’m new to pointers in general and very new to smart pointers.
My UInventoryItem class is very simple; it’s completely empty and just inherits from UObject publicly.
Why could this be, and how can I change the code to fix it? I’d like to stay away from raw pointers entirely unless I have no other choice.