C++ Template Question

Mosfet daniel.duley at verizon.net
Mon Aug 20 14:45:55 BST 2007


Woebbeking over on kde-commits pointed out to me this little gem, 
QVarLengthArray:

http://doc.trolltech.com/4.3/qvarlengtharray.html

Looks like a nice alternative to new as it allocates data on the stack, not 
the heap, so should be quick and you don't have to worry about delete.

The only question I have about it is if it is possible to use this to create a 
multidimensional array and if so what is the proper way? I'm not a template 
expert so don't know. I could of course just allocate one block and use 
offsets but I like using indexes if possible :)




More information about the kde-core-devel mailing list