Effective STL 3: Make copying cheap and correct for objects in containers @ 5/20/2006

programming & research
When you insert/push an object into a container, or when you move objects around the container, they get copied.

If copying for objects in containers, the time spent in copying the objects may greatly influence the performance of your program. To avoid this, you can use containers of pointers. However, containers of pointers have their own headaches, as you will see in Item 7. It will be better to use smart pointers.
发布于 5/20/2006 19:18:24 | 评论:0