On 4/25/12, bearophile <[email protected]> wrote:
> Mehrdad:
>
>> if D
>> hadn't been so shortsighted and hadn't removed typedef's...
>
> Now there's std.typecons.Typedef

Right, but the error messages will be awful, e.g.:

struct None { }
alias Typedef!None HWND;

void test(HWND a, void* b) { }
void main()
{
    test(null, null);
}

test.d(24): Error: function test.test (Typedef!(None,None()) a, void*
b) is not callable using argument types (typeof(null),typeof(null))

We can't just use Typedef!(void*) or Typedef!(int) because -=/+= will
be allowed, which shouldn't be allowed for handles. const(void*) won't
work either, because you should be allowed to assign one handle to
another and const forbids that.

Reply via email to