Le 11/12/2011 13:05, kenji hara a écrit :
2.057 will compile this code, because it adds the new feature.
Now null literal has the type that is expressed as typeof(null), not void*.
And typeof(null) is derived from all class types.
static assert(is(typeof(null) : Bob)); // pass in 2.057
Then IFTI works with null literal correctly.
Kenji Hara
2011/12/11 Andrew Wiley<[email protected]>:
---
class Bob {
}
void doSomething(T)(Bob bob, T data) {
}
void main() {
doSomething(null, 5); // Error: template test.doSomething(T) does not
match any function template declaration
// Error: template test.doSomething(T) cannot deduce template
function from argument types !()(void*,int)
}
---
Bug?
Nice ! This will help generic programming a lot.