c ++相当于java集合 [英] c++ equivalent of java collections
问题描述
hi-
哪里会有人找到像列表,集合,地图类这样的东西,比如
哈希图或树图。不是特别的那些,但一般来说是
一本书处理它的部分?在java中你可以使用接口
而不必了解所有的实现细节。
是否有一个接口到c ++中带有这些方法的库?
i从两个非常基本的入门课程中学到一点c ++。
然而,每次我们想要这个功能我们都要编程
$ b $它。一个很酷的例子是,如果我想要一个TCL没有的数据结构
。我可以用C ++扩展TCL。
感谢让我知道人们使用的是什么。
jim
hi-
where would someone find things like lists, sets, map classes like a
hash map or tree map. not specifically those but in general is there
a book section that deals with it? in java you can use the interface
to these without having to know all of the implementation details.
is there an interface to a library with these kind of methods in c++?
i knew a little c++ from 2 really basic introductory courses.
however, each time we wanted this functionality we had to program
it. an example where this would be cool is if i wanted a data structure
that TCL didn''t have. i could extend TCL with C++.
thanks for letting me know what people use.
jim
推荐答案
i刚刚找到STL的列表点。
谢谢,
后来
i just found a listing point to the STL.
thanks,
later
3rdshiftcoder写道:
3rdshiftcoder wrote:
hi-
哪里会有人找到像列表这样的东西集合,映射类如
哈希映射或树映射。不是特别的那些,但一般来说是
一本书处理它的部分?
hi-
where would someone find things like lists, sets, map classes like a
hash map or tree map. not specifically those but in general is there
a book section that deals with it?
这被称为标准模板库。 (STL)并且是C ++标准的规范部分。 STL不仅像你提到的那样包含
容器,还包括排序或查找等算法。
有很多书可以讨论这些。
参考我经常使用,但有点过时的是STI上的SGI网站
网站(我有一段时间没看过它们 - 也许它是
更新了) 。
http://www.sgi.com/tech/stl/
SGI已经实施了一些不属于标准的容器所以
你需要小心一点。
几乎所有时间都在现代c ++代码中使用的是:
basic_string
vector
list
map
sort
我所知道的不是现行标准的一部分:
hash_map
rope
....可能是其他人。
缺少SGI示例一些命名空间说明符。通常使用命名空间std的
;示例中的某处修复了这些问题。
This is referred to as the "standard template library" (STL) and is a
normative part of the C++ standard. Not only does the STL encompass
containers like you have mentioned but also algorithms like sort or find.
There are many books that discuss these.
The "reference" I used often but it is a little dated is the SGI web
site on the STL (I have not looked at them for a while myself - maybe it
is updated).
http://www.sgi.com/tech/stl/
SGI has implemented some containers that are not part of the standard so
you need to be a little careful.
The ones you will use almost all the time in modern c++ code are:
basic_string
vector
list
map
sort
The ones I know are not part of the current standard are:
hash_map
rope
.... probably others.
The SGI examples are missing a few namespace specifiers. Usually a
using namespace std; somewhere in the example fixes those probs.
嗨Gianni -
这是一个非常酷的链接: - )
i认为这值得一试!
学校前两个学期的编码非常基础。
这绝对是一些缺失的东西。
非常感谢,
jim
" Gianni Mariani" < gi ******* @ mariani.wswrote in message
news:46 *********************** @ per-qv1-newsreader-01.iinet.net.au ...
Hi Gianni -
that is a very cool link :-)
i think this is worth checking out !
the first 2 semesters of coding at school were very basic.
this is definitely some of the stuff that is missing.
thanks very much,
jim
"Gianni Mariani" <gi*******@mariani.wswrote in message
news:46***********************@per-qv1-newsreader-01.iinet.net.au...
3rdshiftcoder写道:
3rdshiftcoder wrote:
> hi-
有人会在哪里找到像列表,集合,地图类,如
哈希地图或树图。不是特别是那些但总的来说有一个书的部分处理它吗?
>hi-
where would someone find things like lists, sets, map classes like a
hash map or tree map. not specifically those but in general is there
a book section that deals with it?
这被称为标准模板库。 (STL)并且是C ++标准的规范部分。 STL不仅像你提到的那样包含
容器,还包括排序或查找等算法。
有很多书可以讨论这些。
参考我经常使用,但有点过时的是SGI网站
在STL上(我有一段时间没看过他们 - 也许是
更新了) 。
http://www.sgi.com/tech/stl/
SGI已经实施了一些不属于标准的容器所以
你需要小心一点。
几乎所有时间都在现代c ++代码中使用的是:
basic_string
vector
list
map
sort
我所知道的不是当前标准的一部分:
hash_map
rope
...可能是其他人。
SGI示例缺少一些名称空间说明符。通常使用
命名空间std;示例中的某处修复了这些问题。
This is referred to as the "standard template library" (STL) and is a
normative part of the C++ standard. Not only does the STL encompass
containers like you have mentioned but also algorithms like sort or find.
There are many books that discuss these.
The "reference" I used often but it is a little dated is the SGI web site
on the STL (I have not looked at them for a while myself - maybe it is
updated).
http://www.sgi.com/tech/stl/
SGI has implemented some containers that are not part of the standard so
you need to be a little careful.
The ones you will use almost all the time in modern c++ code are:
basic_string
vector
list
map
sort
The ones I know are not part of the current standard are:
hash_map
rope
... probably others.
The SGI examples are missing a few namespace specifiers. Usually a using
namespace std; somewhere in the example fixes those probs.
这篇关于c ++相当于java集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!