Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: appending/j...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 45898 of 47472
Post > Topic >>

Re: appending/joining STL::deque/list containers in constant time

by Carter <cartercheng@[EMAIL PROTECTED] > May 14, 2008 at 02:37 PM

On May 14, 5:37 am, Jerry Coffin <jcof...@[EMAIL PROTECTED]
> wrote:
> In article <4bf0797c-e72f-4607-b0c1-8eaba4afcd44
> @[EMAIL PROTECTED]
>, carterch...@[EMAIL PROTECTED]
 says...
>
> > This is probably somewhat of a beginners question but I am unfamiliar
> > with alot of aspects of C++. What is the correct way to append
> > multiple STL containers together in constant time. Obviously you can
> > do this with a linked list but is it possible to do the same thing
> > with the standard containers?
>
> If you're using std::list, you can use list::splice to do the job. I
> don't believe any of the other standard containers offers an equivalent.
>
> --
>     Later,
>     Jerry.
>
> The universe is a figment of its own imagination.

I will give this a try thanks. It seems to be an interesting
limitation that
for the std::deque you cannot do the same thing. In my cast a
std::list should do
the trick though. I understand the objection raised too- but it seems
a bit
unfortunate that given we have library of linked and doubly linked
lists that
you cannot perform shallow merging in cases where the containers being
merged from
are being discarded.

Regards,

Carter.
 




 7 Posts in Topic:
appending/joining STL::deque/list containers in constant time
Carter <cartercheng@[E  2008-05-13 08:34:50 
Re: appending/joining STL::deque/list containers in constant tim
Christopher <cpisz@[EM  2008-05-13 11:11:10 
Re: appending/joining STL::deque/list containers in constant tim
Carter <cartercheng@[E  2008-05-13 12:41:18 
Re: appending/joining STL::deque/list containers in constant tim
Jerry Coffin <jcoffin@  2008-05-13 15:37:04 
Re: appending/joining STL::deque/list containers in constant tim
Christopher <cpisz@[EM  2008-05-13 15:49:14 
Re: appending/joining STL::deque/list containers in constant tim
Carter <cartercheng@[E  2008-05-14 14:37:06 
Re: appending/joining STL::deque/list containers in constant tim
Jerry Coffin <jcoffin@  2008-05-14 17:43:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Aug 29 2:20:26 CDT 2008.