On 07/04/2013 10:14 AM, monarch_dodra wrote:
> Casting merely changes the "observed type", whereas "to" does a deep 
> conversion.

What are the speed implications of to compared to cast?

I ask because I see various casts in Phobos, and wonder if there isn't improved
safety in preferring instead to use to, so long as the optimal speed is there
with appropriate compiler optimizations.

I'm particularly concerned here because of a bug I observed that would have been
caught if to had been used rather than cast:
http://d.puremagic.com/issues/show_bug.cgi?id=10322#c4

(I'm working on a fix, it's just time constraints that have delayed delivering 
it:-)

Reply via email to