What about C's -> ?

Chris Nicholson-Sauls ibisbasenji at gmail.com
Tue Jul 24 16:17:04 PDT 2007


freeagle wrote:
> nope, it does not:
> 
> import tango.io.Stdout;
> 
> class Test
> {
>         int a;
> }
> 
> int main(char[][] args)
> {
>         Test a = new Test();
>         a.a = 13123;
>         Test* pa = &a;
>         Test** ppa = &pa;
>         Test*** pppa = &ppa;
> 
>         Stdout(pppa.a).newline;
> 
>         return 0;
> }
> 
> test.d(16): Error: no property 'a' for type 'Test**'

Well I'll be darned.  :)

If this usage is actually cropping up, then I guess there ought to be a 
feature request put in for it.  (In hand tooled code, its no big issue 
just to partially dereference in place, but in generic code from 
templates, mixins, what have you, this could potentially be hazardous.)

-- Christopher Nicholson-Sauls


More information about the Digitalmars-d-learn mailing list