pointers, null and Typedef...

Paolo Invernizzi paolo.invernizzi at gmail.com
Fri Aug 23 11:58:42 PDT 2013


On Friday, 23 August 2013 at 12:17:08 UTC, John Colvin wrote:
> so, here's the situation:

On 2.063.2 why not something like this:

---
import std.typecons;
alias T0 = Typedef!(void*, null, "T0");
alias T1 = Typedef!(void*, null, "T1");
static assert( ! is(T0 == T1));
struct A
{
     T0 t;
     this(T0 init)
     {
         t = init;
     }
}
void foo(){
     auto a = A(T0(null));
     // auto b = A(T1(null)); Error!
}
---

Paolo



More information about the Digitalmars-d-learn mailing list