Here be the problem. I guess the solution is to make hasMember work w/
pointers to structs.
// In std.traits:
template hasMember(T, string name)
{
static if (is(T == struct) || is(T == class))
{
enum bool hasMember =
staticIndexOf!(name, __traits(allMembers, T)) != -1;
}
else
{
enum bool hasMember = false;
}
}
This is never true for a pointer. isOutputRange checks whether put()
compiles. The free function put() checks for having a put() member, which
fails for pointers to structs.
On Wed, Sep 15, 2010 at 10:48 AM, Andrei Alexandrescu <[email protected]>wrote:
> I don't know how that made it in. David?
>
> Andrei
>
>
> On 9/15/10 4:39 CDT, Masahiro Nakagawa wrote:
>
>> I noticed the difference of isOutputRange behavior.
>>
>> http://ideone.com/HsmaL
>>
>> Pointer version of isOutputRange returns false on 2.048 and 2.049beta.
>> I did't find the related changelog. Is this a bug?
>>
>>
>> Masahiro
>>
>> On Wed, 15 Sep 2010 06:20:32 +0900, Walter Bright
>> <[email protected]> wrote:
>>
>> http://ftp.digitalmars.com/dmd2beta.zip
>>> _______________________________________________
>>> dmd-beta mailing list
>>> [email protected]
>>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>>>
>> _______________________________________________
>> dmd-beta mailing list
>> [email protected]
>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>>
> _______________________________________________
> dmd-beta mailing list
> [email protected]
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta