hasDataMember and mixin inconsistency
Philippe Sigaud
philippe.sigaud at gmail.com
Mon Jan 28 12:21:10 PST 2013
>> Just testing whether t.M can be assigned to something (ie, is it a value?)
>> I use '_' as a variable name to indicate I don't care for it's precise
>> name/value. It's just a placeholder.
>
>
> Ok, I must be missing something, why "t.D" or is this just a typo?
Ark, typo, sorry about that.
> And secondly wouldn't "x.M = y.M" take care of checking that the member can be
> read and written to ?
t.M = t.M? Yes, you're right.
> Also, doesn't your solution require T to be default constructible ?
Yes, but if a type is not default-constructible, I don't know how to test it.
Maybe testing on typeof(T.M)?
>> Using 2.061 here.
>
>
> Well that was the problem! I was still using 2.060 which seems to have the
> bug. Now that I've moved to 2.061 everything works as expected (your
> implementation and mine).
Great!
More information about the Digitalmars-d-learn
mailing list