2 ms·
Why a shared_ptr/weak_ptr solution wouldn't work? The main entity list would use shared ptrs, while objects themselves would have weak references to other obje
by axilmar 11y ago
Why a shared_ptr/weak_ptr solution wouldn't work?
The main entity list would use shared ptrs, while objects themselves would have weak references to other objects.
When an object wants to use another object, then it has to create a shared_ptr to it.
It might be a little slower than simple integer ids, but it can save a lot of trouble.
- TheLoneWolfling 11y agoYou answered it yourself - speed.