且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

快速链表

更新时间:2023-11-10 10:38:10

我建​​议使用CList对象。


" Peter Schmitz"写道:
I would suggest using a CList object.

"Peter Schmitz" wrote:


对于我目前的应用程序,我需要一个链接列表,我可以在其中访问并尽可能以最快的速度通过 - 添加/删除/插入元素
可能会尽可能慢。现在,我应该使用C / C ++标准库中的哪个模板 - std :: list?或者有更好的实施吗?

感谢
Peter
Hi,

for my current application, I need a linked list in which I can access and
walk through at highest speed possible - adding/deleting/inserting elements
can be as slow as necessary. Now, which template out of the C/C++ standard
library should I use for this - std::list? Or is there a better
implementation out there?

thanks
Peter



自己编写。 ..如果你需要一点备份,请检查CTypedPtrList ...

它是迄今为止我使用过的***的,而不需要在类的扩展上使用。


- MR


" Peter Schmitz" < Pe的********** @ discussions.microsoft.com>在消息中写道

news:28 ********************************** @ microsof t.com ...
Write your own... check CTypedPtrList if you need a little backup on it...
Its by far the best I have used without the need to bolt on extensions to
the classes.

- MR

"Peter Schmitz" <Pe**********@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...


对于我目前的应用程序,我需要一个链接列表,我可以在其中访问并尽可能以最快的速度通过 - 添加/删除/插入元素
可能会尽可能慢。现在,我应该使用C / C ++标准库中的哪个模板 - std :: list?或者有更好的实施吗?

感谢
Peter
Hi,

for my current application, I need a linked list in which I can access and
walk through at highest speed possible - adding/deleting/inserting
elements
can be as slow as necessary. Now, which template out of the C/C++ standard
library should I use for this - std::list? Or is there a better
implementation out there?

thanks
Peter



Peter Schmitz写道:
Peter Schmitz wrote:


对于我目前的应用程序,我需要一个链接列表,我可以访问并以最高速度访问 -


通过''access''你的意思是''遍历'',如:


for(container :: iterator lItr = c.begin(); lItr!= c.end(); ++ lItr)

{

//用* lItr做某事

}


添加/删除/插入元素可能会尽可能慢。现在,


这些使用模式不需要链表。

我应该使用C / C ++标准库中的哪个模板
这个 - std :: list?或者有没有更好的实现?
Hi,

for my current application, I need a linked list in which I can
access and walk through at highest speed possible -
By ''access'' do you mean ''traverse'' as in:

for( container::iterator lItr = c.begin() ; lItr != c.end() ; ++lItr )
{
// do something with *lItr
}

adding/deleting/inserting elements can be as slow as necessary. Now,
These usage patterns do not require a linked list.
which template out of the C/C++ standard library should I use for
this - std::list? Or is there a better implementation out there?




std :: vector将是一个更好的选择给定你的使用模式,添加

减少内存消耗和碎片化的好处。


Jeff Flinn



std::vector would be a better option given your usage patterns, with the
added benefit of less memory consumption and fragmentation.

Jeff Flinn