Re: [gtk-list] Re: Gtk--: G_List quirks



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.

Regards
M.Beach



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]