C++ Template Question

Olivier Goffart ogoffart at kde.org
Wed Aug 22 23:24:11 BST 2007


Le lundi 20 août 2007, Mosfet a écrit :
> http://doc.trolltech.com/4.3/qvarlengtharray.html

btw...


 int myfunc(int n)
 {
     int table[n + 1];  // WRONG
     ...
     return table[n];
 }

This works fine with GCC (unless you use --pedantic)
It's a nice gnu extention.
Does it works with others compiler supported by KDE?

Or is there a compiler supported by KDE which doesn't support it? If no, then 
we could use that.  Would it be possible to have some macro which allow 
arrays dynamically on the stack if the compiler is GCC, and use 
QVarLengthArray otherwise? Would that be worth?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070823/ac575665/attachment.sig>


More information about the kde-core-devel mailing list