Major performance problem with std.array.front()

Adam D. Ruppe destructionator at gmail.com
Fri Mar 7 06:13:53 PST 2014


On Friday, 7 March 2014 at 10:44:46 UTC, Kagamin wrote:
> Now it's passed by value.

That won't work for operator overloading though (which is the 
really interesting case here).

> Though, I needed checked arithmetic only twice: for cast from 
> long to int and for cast from double to long. If you expect 
> your number type to overflow, you probably chose wrong type.

I very rarely need it too, but it is nice to have in a convenient 
package that is fairly efficient at the same time.


More information about the Digitalmars-d mailing list