Time to kill T() as (sometimes) working T.init alias ?

Rob T rob at ucora.com
Fri Nov 30 23:12:51 PST 2012


On Friday, 30 November 2012 at 07:20:39 UTC, monarch_dodra wrote:
> Related:
> Why doesn't:
> "auto a = int(5);"
> work? and, even more importantly, why don't we have this? :
> "int* p = new int (5);"
> The fact that we have "T()/T(arg)", but not "int()/int(arg)" 
> makes *zero* sense to me. THAT has been a source of initial 
> confusion when I moved to D.

I'd like to point out that what you are describing are examples 
of inconsistencies in D, and inconsistencies tend to be a 
significant cause of productivity loss in many areas. They 
needlessly complicate the learning curve, the users code, and 
even the documentation, and unless eliminated they will forever 
taint the user experience to a degree.

As for the way structs are default constructed, I found it to be 
very difficult to comprehend. The documentation needs to be made 
better and more detailed. However, I've come around to think that 
the behaviors are correct and worth putting up with. Yes it can 
be very confusing at times, so if there's a way to make it less 
confusing, that would be a big help.

--rt



More information about the Digitalmars-d mailing list