From: eyal DOT ben-david AT aks DOT com To: SL AT usemail DOT com cc: djgpp AT delorie DOT com Message-ID: <4225654D.004106E6.00@aks.com> Date: Wed, 12 Nov 1997 14:38:01 +0200 Subject: Re: Containers/Templates etc Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Precedence: bulk On 11/12/97 1:48:09 AM sl wrote: >Hi, > > It seems I am not the only one confused about Containers/Templates, where it is their purpose, >implementation or whatever else. Would some care to explain this to us? :) > > What is the purpose of Containers, what are they used for? > > I understand templates are used to have a Class of so basicly I can make >a template called Array and when using it in my program I'd go: > > "Array dummy" > > And dummy would be a variable of type Array of int. Therefore the class Array would handle int as its >basic variable. Ok, now, what are containers? :) > >Gili > > Hello Gili Container is a data structure that *contains* other objects. For example, your Array above is a container of ints. Simple C arrays are also containers since they contain objects of their element type. The standard library has many container classes (all in the form of a template) for example: vector, list, deque, set, and many more. Eyal.