Inside 5 layers of metaprogramming a mild inconsistency can break everything and require nested trait hell static ifs to fix. The base types just don't offer a consistent interface.
int.init!=float.init
but what are you supposed to do besides when you write a function header such as foo(T)(T a, T b=T.init)
Also user types need to use op overloads where theres no drop in replacement for base types, I can't just use opCmp()=>child.opCmp; I have to detect if its a base type and handle.
In practice there are three cases for even conceptually simple composite type, user types, the usual base type behavior, a weird edge case base type; don't do that.
I suggest extending all base types with at least 5 values(with example int,float,string):
- zero: 0, 0.0., ""
- invalid: max-1, nan, "ERROR"
- onevalue: 1, 1.0, "1"
- negative_value: -1 (signed) max (unsigned), -1, "WARNING"
- min: .min, .min_normal, ""
And then define element op overloads(such as opCmp), toString, toHash for each base type