Re: [gtk-list] Re: Gtk--: G_List quirks
- From: Michael Beach <mbeach zip com au>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Gtk--: G_List quirks
- Date: Tue, 04 Aug 1998 02:23:25 +1000
Michael Beach wrote:
> Kevin Handy wrote:
> > One thing that the STL does give you, as opposed to the (void *)
> > pointers, is it doesn't have to store the pointer to the data,
> > wich saves you 4 bytes (or more) of storage for each node.
> > If you have a fairly large list, the savings in (data space)
> > memory can be subatantial. (You may think of it as trading
> > code space for data space).
> Come on, surely you are pulling my leg here! Do you think that STL is
> magic? Just because you don't need a next pointer in the node doesn't
> mean there is no pointer at all! The actual data structures comprising
> the list would no doubt be templated on the type T you give when
> instantiating the list<T> template, and you can bet your bottom dollar
> that they will have pointer members as well as a member of class T.
Oops, sorry to reply to myself, but I think I've really put my foot in
it here! I guess Kevin was comparing a typical STL implementation to a
list implementation where the list nodes are separate from (and point
to) the data items in the list. Mea culpa, mea maxima culpa!
] [Thread Prev