0

Hello.

I'm going to create a stack of pointers to objects, and I need to implement an identifier with the best performance.
Those objects are custom classes.

I'm wondering what would be best for performance. Either of these two ways, or maybe a third better way?.

1) Making an std::map for the stack, with a string identifier.
2) Making an std::vector with just the pointer, and then loop through all the objects (which may be 50+, each containing a few kilobytes), and read object::name which would be a string too.

And again to mention, if theres a better way, please hint me :)

Thank you ahead! :D

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by Excizted
0

I'm going to create a stack of pointers to objects

You might also want to take a look at std::stack and std::deque

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.