Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newscore.univie.ac.at!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Newsgroups: comp.lang.c++ Subject: Re: STL vector References: Date: Thu, 17 Nov 2011 16:45:07 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Peter Liedermann" Message-ID: User-Agent: Opera Mail/11.52 (Win32) X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch Lines: 26 NNTP-Posting-Host: 80.219.145.247 (80.219.145.247) NNTP-Posting-Date: Thu, 17 Nov 2011 16:47:10 +0100 X-Trace: ef77a4ec52c7ef57e345230680 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:11570 On Wed, 16 Nov 2011 15:02:44 +0100, Leigh Johnston wrote: > On 15/11/2011 19:50, Peter Liedermann wrote: > If you are going to allocate the Jumbo objects separately for use in > vector then you might as well just use std::set; std::set > will keep the items sorted. > Thank you for the suggestion. However, I am not going to use set because I occasionally have to re-sort. In my case, this resort would be quite intense, that is, almost everything is repositioned each time. This is definitely not a hot spot in the algorithm, but I do not want to swear that it occurs at most so and so often. For this reason, I want to avoid tree-like structures, which an STL set essentially is. But BTW, this takes us back to a variation the original question: Would you, given the use of a set, really use std::set or std::set instead and does it make a difference (that is, does replacing "vector" by "set" in the original question make a difference) Regards. Peter