On Wednesday 05 March 2003 12:28 pm, Felix Kühling wrote:
[snip]
> The developer may as well implement his own container types as
> templates. My point is that STL seems quite bloated and often a bit
> clumsy to use. The code I wrote using STL was never exactly well
> readable (maybe my own fault). It is a great abstraction, and if you
> need more advanced container types and don't *want* to worry about
> allocation issues, than it's a great tool. But for the purpose of a
> driver I'd prefer implementing a linked list as a linked list myself.

Perhaps it's bloated, perhaps not.  One of the points I tried to make earlier 
is that the STL is designed so that you *can* specify allocation policies.  
The fact that it was designed specifically to provide such an option places 
it higher on my list of reusable code.  If it solves some of the problems 
involved (which Jose thinks it probably will not), it is at least possible to 
transparently (to the end coder) alter the underlying allocation mechanism to 
whatever is necessary.  That, imo, is truly powerful reuseablility.

And in the case where new container types are written instead, yes, 
templatized would be the way to go, and I would highly suggest borrowing from 
the allocation mechinisms in the STL to achieve similar flexibility.

A very nice thing is that you could write your own templatized linked-list, 
and provide iterator classes such that it has the same feel and use as the 
rest of the stdlib that people are already familiar with.  Then you leave it 
possible to use the stdlib templatized algorithms on it as well if they 
happen to suit...


Nick


-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to