Re: casting class pointer

2010-11-19 Thread Simen kjaeraas
Jesse Phillips jessekphillip...@gmail.com wrote: auto hi = hello in b.all; auto foo = cast(B) hi; The result was that b.label wasn't the same, and printing out stuff resulted in a bunch of garbage. Not surprising. hi is pointing to a reference (pointer) to a B instance,

casting class pointer

2010-11-18 Thread Jesse Phillips
I usually avoid using pointers and classes together (actually I don't use pointers very much). But using 'in' on an associative array provides a pointer. In any case, I ended up casting the pointer to the class type. (The simplified example isn't showing the behavior). The results were not

Re: casting class pointer

2010-11-18 Thread Jonathan M Davis
On Thursday, November 18, 2010 14:20:01 Jesse Phillips wrote: I usually avoid using pointers and classes together (actually I don't use pointers very much). But using 'in' on an associative array provides a pointer. In any case, I ended up casting the pointer to the class type. (The

Re: casting class pointer

2010-11-18 Thread Jesse Phillips
Jonathan M Davis Wrote: Just dereference the pointer. I believe that in effect you have a pointer to a reference, not a pointer to an Object. Regardless of what it does internally though, the way to get at the object is to dereference it. If you had The question wasn't exactly about how