digitalmars.D.bugs - offsetof bug
- Ben Hinkle (10/10) Jul 04 2005 class Foo {
- Jarrett Billingsley (5/7) Jul 04 2005 Might have to do with the fact that class members are free to be rearran...
- Ben Hinkle (4/11) Jul 04 2005 The posted example is pretty much the same as the one from the doc (see ...
- Uwe Salomon (5/19) Jul 04 2005 Please read my post in digitalmars.D. "Ben Hinkle" in the subject :)
- Ben Hinkle (3/23) Jul 04 2005 got it - thanks!
class Foo { int x; } void main() { Foo.x.offsetof; } gives C:\d>dmd off.d off.d(5): 'this' is only allowed in non-static member functions off.d(5): this for x needs to be type Foo not type int
Jul 04 2005
"Ben Hinkle" <ben.hinkle gmail.com> wrote in message news:dac0ps$1hh4$1 digitaldaemon.com...off.d(5): 'this' is only allowed in non-static member functions off.d(5): this for x needs to be type Foo not type intMight have to do with the fact that class members are free to be rearranged by the compiler. The compiler may not know the offsets of the members until a later phase.
Jul 04 2005
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message news:dac313$1jcg$1 digitaldaemon.com..."Ben Hinkle" <ben.hinkle gmail.com> wrote in message news:dac0ps$1hh4$1 digitaldaemon.com...The posted example is pretty much the same as the one from the doc (see the Classes page about Field properties). I haven't gotten offsetof to work.off.d(5): 'this' is only allowed in non-static member functions off.d(5): this for x needs to be type Foo not type intMight have to do with the fact that class members are free to be rearranged by the compiler. The compiler may not know the offsets of the members until a later phase.
Jul 04 2005
On Mon, 04 Jul 2005 21:53:57 +0200, Ben Hinkle <bhinkle mathworks.com> wrote:"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message news:dac313$1jcg$1 digitaldaemon.com...Please read my post in digitalmars.D. "Ben Hinkle" in the subject :) Ciao uwe"Ben Hinkle" <ben.hinkle gmail.com> wrote in message news:dac0ps$1hh4$1 digitaldaemon.com...The posted example is pretty much the same as the one from the doc (see the Classes page about Field properties). I haven't gotten offsetof to work.off.d(5): 'this' is only allowed in non-static member functions off.d(5): this for x needs to be type Foo not type intMight have to do with the fact that class members are free to be rearranged by the compiler. The compiler may not know the offsets of the members until a later phase.
Jul 04 2005
"Uwe Salomon" <post uwesalomon.de> wrote in message news:op.stem8xwn6yjbe6 sandmann.maerchenwald.net...On Mon, 04 Jul 2005 21:53:57 +0200, Ben Hinkle <bhinkle mathworks.com> wrote:got it - thanks!"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message news:dac313$1jcg$1 digitaldaemon.com...Please read my post in digitalmars.D. "Ben Hinkle" in the subject :) Ciao uwe"Ben Hinkle" <ben.hinkle gmail.com> wrote in message news:dac0ps$1hh4$1 digitaldaemon.com...The posted example is pretty much the same as the one from the doc (see the Classes page about Field properties). I haven't gotten offsetof to work.off.d(5): 'this' is only allowed in non-static member functions off.d(5): this for x needs to be type Foo not type intMight have to do with the fact that class members are free to be rearranged by the compiler. The compiler may not know the offsets of the members until a later phase.
Jul 04 2005