
On 3/29/07, Steven Watanabe <steven@providere-consulting.com> wrote:
Matthias Schabel <boost <at> schabel-family.org> writes:
Mathias, for this reason quantity_cast should be
quantity_cast<quantity<SI::force> >(q)
Agreed?
I'm actually wondering if we can completely eliminate quantity_cast - with the new quantity_reinterpret_cast and the new conversions including value type, it seems like it is redundant. If so, I'd rather just get rid of it...
I think it's important to be able to differentiate between conversions that are typesafe (quantity_cast) and those that are not (quantity_reinterpret_cast).
I actually prefer to use quantity_cast instead of quantity_reinterpret_cast. After all, the behavior of reinterpret_cast is unspecified except that certain conversions are reversible, while quantity_reinterpret_cast is always well-defined.
While quantity_reinterpret_cast may not be perfectly analogous to reinterpret_cast, it represents the reinterpretation of a raw number as being of a different type, and so I think it's a pretty good name. Just as importantly, I can't think of anything better. Do you have any other ideas? quantity_unsafe_cast? quantity_arbitrary_cast? :) Zach Laine