offsetof

Tim M a at b.com
Fri Nov 7 17:59:42 PST 2008


Did you find a sollution? I need to get the offset of a member of a struct  
so I can port a .h to a .di but dmd complains that the member doesn't  
exist on the struct. I dont think anyone has ever tried the code at:  
http://www.digitalmars.com/d/1.0/ctod.html#fieldoffset

On Fri, 22 Aug 2008 10:25:05 +1200, Jarrett Billingsley  
<kb3ctd2 at yahoo.com> wrote:

> "Heinz Traub" <malagana15 at yahoo.es> wrote in message
> news:g8kivv$b19$1 at digitalmars.com...
>> Jarrett Billingsley Wrote:
>>
>>> "Jarrett Billingsley" <kb3ctd2 at yahoo.com> wrote in message
>>> news:g8kh8p$6c4$1 at digitalmars.com...
>>>
>>> > It's actually exactly the opposite from how it's defined in the spec:
>>> > you
>>> > can only use offsetof on instances of user-defined types, not on the
>>> > type
>>> > itself.
>>> >
>>> > It makes _absolutely_ no sense, I know.  I can't help but feel it's a
>>> > bug,
>>> > but it's been this way for over 4 years.
>>> >
>>>
>>> I take that back, it used to be this way but something seems to have
>>> changed.
>>>
>>>
>>
>> Yes sir, it used to be this way. I also checked it in your engine
>> (nonagon).
>
> Well how about that!  I couldn't help but think DIMOUSESTATE sounded
> familiar.
>
>



More information about the Digitalmars-d-learn mailing list