[Issue 979] New: offsetof for classes does not work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 17 20:52:54 PST 2007


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

           Summary: offsetof for classes does not work
           Product: D
           Version: 1.005
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: benoit at tionex.de


from: http://www.digitalmars.com/d/class.html
the example
class Foo
{
    int x;
}
void test(Foo foo)
{
    size_t o;

    o = Foo.x.offsetof;   // yields 8
}


t.d(12): Error: 'this' is only allowed in non-static member functions, not test
t.d(12): Error: this for x needs to be type Foo not type int


-- 



More information about the Digitalmars-d-bugs mailing list