Phobos, std.typecons: arrays of Rebindable

pc peng2cheng2 at yahoo.com
Sat Dec 26 15:42:48 PST 2009


Done.

I am only up to chapter 6, but so far, IMHO, TDPL is a really great book. Thanks for writing it.

I would like to see a chapter that introduces (to the extent not discussed in the context of generic functions and class), the template related concepts that are manifest in std.traits, std.typetuple, std.algortim, std.typecons, std.conv. Perhaps a second book - Phobos and D Tempates or the like is really what is needed. Even if you can't fit this in, a little more explanation on how to pick up imputed types like T and U in T[U], would be helpful.

In any case, I was at a loss understanding the "const(U), U" in the following (from Rebindable in std.typecons) based on the description of "is Expresions" at 2.4.1.4.3.

  static if (!is(T X == const(U), U) && !is(T X == invariant(U), U))

Granted, this example did not come from the book, and I know that you cannot possibly explain everything, but I have the feeling that this way of picking up U, as well as T, is fundamental and should not be left out of the book.

Like I said, the book is great -- even in draft.

Thanks again,

pc




More information about the Digitalmars-d mailing list