D-Programming-Language/phobos — pull request #488 by 9rnsr (2012-03-11 16:42:51+00:00)
Title: std.format improvement for alias this type interaction

Points:

- Add `SomethingTypeOf` templates to std.traits
When T is a subtype of built-in type, SomeThing!T returns the built-in type.

```d
static assert(is(IntegralTypeOf!int == int); // T is exact built-in type
struct S{ int x; alias x this; } // S is a subtype of int
static assert(is(IntegralTypeOf!S == int); // T is a subtype of built-in type
```

- Use `SomethingTypeOf` for the implementation of `isSomething`

Then isSomething considers the subtypes generated by alias this.

- In std.format, we can distinguish aggregates that has alias this or not.

This pull requires following dmd fixes.
https://github.com/D-Programming-Language/dmd/pull/797
https://github.com/D-Programming-Language/dmd/pull/798
https://github.com/D-Programming-Language/dmd/pull/799
https://github.com/D-Programming-Language/dmd/pull/800