Vector Copy vs. shared ptr.
I’ve got a simple function that I wrote a while back that pushes vectors of longs with anywhere from 4-8 long values onto a queue. At the moment I’m simply pushing copies of vectors with the longs in there, once the queue is iterated though the queue then removes the vectors from it. In all I think there only two copies made so I’m wondering if it’s worthwhile to go back and update this to use something like a shared pointer or just keep it like this. Its low volume too so it’s not something that’s going to happen a lot.
I’m guessing the right thing to do is just leave it and in the future use boost shared_pts instead.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement