D - VLAs?
- Matthew Wilson (18/18) Sep 13 2003 Walter, just wondered whether we can have VLAs (via alloca()) for
-
Walter
(3/21)
Sep 13 2003
I think it's a good idea. Just need more time in the day
. - Matthew Wilson (3/32) Sep 13 2003 nw. :)
Walter, just wondered whether we can have VLAs (via alloca()) for fundamental types? In other words, rather than having to write something like bool lookup(int id, char *buff, inout uint cchBuff); uint cchBuff; if(lookup(<someid>, null, cchBuff)) { char[] buff = new char[cchBuff]; lookup(<someid>, buff, cchBuff); } it'd be nice to have the option of writing uint cchBuff; if(lookup(<someid>, null, cchBuff)) { char buff[cchBuff]; // <== This is allocated via alloca() lookup(<someid>, buff, cchBuff); } Thoughts?
Sep 13 2003
"Matthew Wilson" <matthew stlsoft.org> wrote in message news:bk0m9o$31i7$1 digitaldaemon.com...Walter, just wondered whether we can have VLAs (via alloca()) for fundamental types? In other words, rather than having to write something like bool lookup(int id, char *buff, inout uint cchBuff); uint cchBuff; if(lookup(<someid>, null, cchBuff)) { char[] buff = new char[cchBuff]; lookup(<someid>, buff, cchBuff); } it'd be nice to have the option of writing uint cchBuff; if(lookup(<someid>, null, cchBuff)) { char buff[cchBuff]; // <== This is allocated via alloca() lookup(<someid>, buff, cchBuff); } Thoughts?I think it's a good idea. Just need more time in the day <g>.
Sep 13 2003
nw. :) "Walter" <walter digitalmars.com> wrote in message news:bk10dd$dj3$3 digitaldaemon.com..."Matthew Wilson" <matthew stlsoft.org> wrote in message news:bk0m9o$31i7$1 digitaldaemon.com...Walter, just wondered whether we can have VLAs (via alloca()) for fundamental types? In other words, rather than having to write something like bool lookup(int id, char *buff, inout uint cchBuff); uint cchBuff; if(lookup(<someid>, null, cchBuff)) { char[] buff = new char[cchBuff]; lookup(<someid>, buff, cchBuff); } it'd be nice to have the option of writing uint cchBuff; if(lookup(<someid>, null, cchBuff)) { char buff[cchBuff]; // <== This is allocated via alloca() lookup(<someid>, buff, cchBuff); } Thoughts?I think it's a good idea. Just need more time in the day <g>.
Sep 13 2003