[Issue 8545] defined opCast disables cast(void*)this in classes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 12 21:50:51 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8545


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla at digitalmars.com
         Resolution|                            |INVALID


--- Comment #2 from Walter Bright <bugzilla at digitalmars.com> 2012-08-12 21:50:50 PDT ---
I don't think this is major, because you can use a union:

{
    static union U { Object o; void* p; }
    U u;
    u.o = this;
    return u.p;
}

In fact, because a union can be used for reinterpret casting, I don't think any
new syntax or semantics are needed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list