On Wednesday, January 02, 2013 00:37:32 d coder wrote: > > That's not how you define implicit conversions in D. It's a weird hack > > from C++. > > Thanks for clarification. I knew about alias this, but I thought it was in > addition to constructor path.
Nope. It's the _only_ way to define implicit conversions in D. In general, D requires explicit conversions in order to avoid all of the problems that implicit conversions cause in C++ (e.g. C++ will do up to 3 implicit conversions when passing an argument to a function; that gets particularly nasty when combined with function overloading; you can quickly have no idea what's actually being called without stepping through the code). - Jonathan M Davis
