Implementing and optimizing a simple graph metric

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Fri Sep 27 04:50:38 PDT 2013


On Thursday, 26 September 2013 at 22:03:12 UTC, bearophile wrote:
> Joseph Rushton Wakeling:
>
>> T is qualified via isFloatingPoint :-)
>
> I know, but that qualification could change in future 
> evolutions of your code. Strong type safety means that if you 
> change a type in your code, with a localized change (like 
> removing isFloatingPoint at the top of your function) the whole 
> code that depends on that type (like the body of this function 
> of yours) will keep working as safely as before :-)

OK, I accept your argument :-)

As things stand I'm inclined to leave the code using "new" for 
now. I'll see if I can work out anything about why 
minimallyInitializedArray might be problematic -- at a guess, 
perhaps it accidentally gets in the way of some potential 
optimizations?


More information about the Digitalmars-d-announce mailing list