Array operations -- not actually so difficult
Bill Baxter
wbaxter at gmail.com
Fri Dec 15 12:18:16 PST 2006
Kirk McDonald wrote:
> Bill Baxter wrote:
>
>> I put it on my D Rants page[1], but I don't think I ever filed it as a
>> bug.
>>
>> [1] http://www.prowiki.org/wiki4d/wiki.cgi?BillBaxter
>>
>> --bb
>
>
> On that page:
>
> -----
> It should be possible to set the init property for a typedef'ed or other
> user defined type. E.g.
>
> typedef int myint;
> myint.init = -1;
> -----
>
> You can do this:
>
> import std.stdio;
> typedef int INT = 20;
> void main() {
> INT i;
> writefln(i); // prints 20
> }
That's interesting. Didn't know that. Seems not as intuitive as
setting .init directly, but now that I think about it, I guess there are
issues with allowing the init value to be set anywhere other that at the
point of type definition.
--bb
More information about the Digitalmars-d
mailing list