I want to create an array of Ptr<Packets> however if I do not allocate the array once it goes out of scope I lose the reference to the Packets.
I found a way to do it but then I had to clean the memory manually myself:
Ptr<Packet> * ptr = new Ptr<Packet>[10];
...
// Once I finish I delete the array of Ptr<Packets>
delete[] ptr;
Is there a way to do define an array of Ptr<> objects so that they get cleaned automatically?