
30 Mar
2007
30 Mar
'07
5:07 p.m.
I prefer quantity_reinterpret_cast myself - more time to think while you're typing...
I don't think the name matters from a safety perspective. How likely is someone to accidently use a cast, especially if it only has a single meaning? Also, extracting the value type is, IMO, safer than static_cast and const_cast because those can produce a value that is incorrect to use at all.
Good point - I'm OK with having a single well-defined quantity_cast, eliminating the other use cases and eliminating quantity_reinterpret_cast - for the latter, users might just as well use the built-in reinterpret_cast... Matthias