delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/09/21/02:24:29

Date: Tue, 20 Sep 1994 19:24:56 -0700 (PDT)
From: Jason Burrell <jburrell AT crl DOT com>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Collection classes in DJGPP?

I wrote a message to comp.lang.c++ asking a relatively simple question: 
How can I dynamically allocate a random number of objects of a particular 
class? I received a couple of responses, and parts of one are below. The 
|> lines are my inquiry, > is his reply. (To avoid any confusion.) 


> |> Maybe a binary tree is what I want, with a few indexing and searching
> |> functions. If I have three types of classes, types A, B, and C, and throw
> |> them in binary trees, I'd need three trees. That's not a problem. Adding
> |> the material one at a time -- if one entry needs to be killed, its marked
> |> as deleted, and the next time I need a place for data it goes there. Is
> |> there a better way?
> |>
> 
> In C people used to painfully reconstruct linked-list code for each type 
> of things they wanted to keep track of.  With C++ and templates we now 
> have things called "collection classes" that hold collection of 
> objects.  These are generally very powerful and flexible containers for 
> any type of objects you want to use.  Chances are your compiler came 
> with a simple set of collection classes or containers that you can use.

Does DJGPP have any prebuilt collection classes? I really have only a 
very vague idea what he's talking about, and that isn't enough to build 
one of these templates. I suppose I could go the linked-list/binary-tree 
route, but now my curiosity has peaked. 

Thanks.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019