[dmd-beta] dmd 2.049 beta

David Simcha dsimcha at gmail.com
Wed Sep 15 08:32:31 PDT 2010


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 <andrei at erdani.com>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
>> <walter at digitalmars.com> wrote:
>>
>>  http://ftp.digitalmars.com/dmd2beta.zip
>>> _______________________________________________
>>> dmd-beta mailing list
>>> dmd-beta at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>>>
>> _______________________________________________
>> dmd-beta mailing list
>> dmd-beta at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-beta/attachments/20100915/b8e8b24e/attachment.html>


More information about the dmd-beta mailing list