在哪种情况下,我使用特定的STL容器? [英] In which scenario do I use a particular STL container?

查看:115
本文介绍了在哪种情况下,我使用特定的STL容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的C ++书,特别是STL和其容器的部分,一直在阅读STL容器。现在我明白每个人都有自己的特定属性,我接近记住所有的人...但是我还没有掌握是在哪种情况下,每个人都被使用。



解释是什么?示例代码是首选。

解决方案

CC BY-SA 3.0授权许可


I've been reading up on STL containers in my book on C++, specifically the section on the STL and its containers. Now I do understand each and every one of them have their own specific properties, and I'm close to memorizing all of them... But what I do not yet grasp is in which scenario each of them is used.

What is the explanation? Example code is much prefered.

解决方案

This cheat sheet provides a pretty good summary of the different containers.

See the flowchart at the bottom as a guide on which to use in different usage scenarios:

Created by David Moore and licensed CC BY-SA 3.0

这篇关于在哪种情况下,我使用特定的STL容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆