On Friday, 7 May 2021 at 16:31:35 UTC, Andrei Alexandrescu wrote:
>BooleanTypeOf
IntegralTypeOf
FloatingPointTypeOf
NumericTypeOf
UnsignedTypeOf
SignedTypeOf
CharTypeOf
StaticArrayTypeOf
DynamicArrayTypeOf
ArrayTypeOf
AssocArrayTypeOf
BuiltinTypeOf
Looking at their subtly repetitive definitions, they are specious to start with, but they have absolutely no comments so who knows what they're useful for.
People ask "what would do phobos better?" and it's ironic because literally whatever file I open there are dozens of immediate and urgent improvements to be done that scream at you.
As far as I can tell from the PR that added them, they were needed so that std.format
can treat struct S(T) { T x; alias x this; }
as T
if T
is a built-in type, by having AbcTypeOf!(S(T))
yield T
, if T
is Abc
(e.g. Boolean, FloatingPoint, etc.) in template constraints.
In other words, it looks like they were meant only for Phobos-internal use. These days, we use package (std)
for such symbols. Perhaps that package
protection attributes were not implemented (or not working reliably) in ~2012?
There is no discussion in that pull request, so perhaps you had discussed the matter with Kenji either on the newsgroup, Bugzilla, in other pull request, or privately?