On 14/12/2016 11:33 AM, Andrei Alexandrescu wrote:
Destroy.
https://github.com/dlang/DIPs/pull/51/files
Andrei
Others have brought up similar syntax to this:
import(my.mod).Type!argsT(7)
import(Identifier).Identifier
It shouldn't be confused with string imports or the like and would be
more akin to a selective import.
Pros:
- Is an expression
- Relatively clear and in line with string imports as an expression
Cons:
- Another language feature to learn (but if I was designing a new
language, this would totally be in it)
- More text that goes into template constraints
- Personally I find if I need an import like this in one constraint, I
want it in a lot more places
- Much longer lines!
```D
void func(T)(T x)
if (import(std.traits).isBasicType!T ||
import(std.traits).isFloatingPoint!T) {
}
```