C tips (again)

Denis Koroskin 2korden at gmail.com
Sat May 2 04:25:38 PDT 2009


On Sat, 02 May 2009 03:56:05 +0400, bearophile <bearophileHUGS at lycos.com> wrote:

> Walter Bright:
>> Why couldn't you do the exact same thing in D?<
>
> Those ctips show some tricks done with the preprocessor that I don't  
> know yet how to do with D1, and there are some situations where in D I'd  
> like to be able to locally disable array bound checks (this is doable in  
> Delphi/FreePascal), like in the data array here:
>
> typedef struct {
>     int size;
>     int capacity;
>     char data[0];
> } Mystring;
>

Mystring s = ...;
char c = s.data.ptr[42];





More information about the Digitalmars-d mailing list