offsetof + foreach
Ellery Newcomer
ellery-newcomer at utulsa.edu
Fri Sep 7 10:33:03 PDT 2012
On 09/07/2012 10:31 AM, Ellery Newcomer wrote:
> I have a struct buffer, and I want to print out its members' offsetof.
>
> This:
>
> foreach(i,_t; buffer.tupleof) {
> writefln("%s@: %s", _t.stringof, _t.offsetof);
> }
>
> complains
>
> Error: undefined identifier 'offsetof'
>
> what should I be doing?
nevermind, I remember tupleof + foreach has always been broken
writefln("%s@: %s", buffer.tupleof[i].stringof, buffer.tupleof[i].offsetof);
More information about the Digitalmars-d-learn
mailing list