Is it possible to specify the address returned by the address of operator?

DreadKyller dreadkyller at gmail.com
Fri Sep 29 02:34:08 UTC 2017


On Thursday, 28 September 2017 at 14:01:33 UTC, user1234 wrote:
> On Thursday, 28 September 2017 at 00:11:56 UTC, DreadKyller 
> wrote:
>> Notice how dereferencing the pointer did not call the 
>> overloaded function, because a pointer to Test is not the same 
>> type as a Test.
>
> Yeah, this is rather made to implement fat pointers.

I understand that, but because the operator isn't defined 
normally for classes unless overloaded, then your statement about 
this being an inconsistency on the concerns stated prior about 
wrecking implementation of standard features. If & can't be 
overloaded then the type of &object will always be a pointer, you 
can't override the dereference operator of the pointer itself as 
far as I can tell, overloading it on the class doesn't overload 
the pointer, thus any standard implementation that uses pointers 
to store an object would be completely unaffected by overloading 
the dereference operator. This I don't consider it an 
inconsistency.

Also Johnathan, yeah, the forum.dlang.org is the same for me as 
kinke said, most the time it goes thorugh nearly immediately, but 
sometimes (about 1/4'th) it takes multiple minutes. The thing is 
that I can open 3 tabs all loading the same page, on multiple web 
browsers, and they'll all stall, then suddenly all of them load 
at the same time. If it persists I may ry making a post as you 
suggested.


More information about the Digitalmars-d-learn mailing list