www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - docs: offset is undocumented

The struct member property "offset" is essentially undocumented (yes, 
it's on http://www.digitalmars.com/d/ctod.html, but I think it should be 
on http://www.digitalmars.com/d/struct.html, too).

Here's an example of how it works (and how it doesn't work):

import std.stdio;

struct S
     int bar;

void main()
    S myStruct;

    /* These do work: */

    /* I think this should work (but it doesn't). */
// writef(myStruct.bar.offset);
// no property 'offset' for type 'int'

    /* This shouldn't work (and it doesn't). */
// writef(myStruct.offset);
// no property 'offset' for type 'S'


(This post was inspired by discussion from this thread:

Justin (a/k/a jcc7)
Jul 25 2004