
"Dave Steffen" <dgsteffen@numerica.us> wrote in message news:17642.14441.683655.649056@yttrium.numerica.us...
Eric Lemings writes: [...]
This brings up a good question. Say you have two objects:
meters m = 1; feet f = 2;
What is the type (or unit) of the following expression?
m + f;
I apologize for repeating myself, but I want this to fail to compile. I do not want implicit conversion of units. I believe I am not completely alone in this view.
Could you provide your rationale for wanting expressions like this to fail? Maybe there is something we've overlooked?
Personally I love implicit unit conversions. :-)
Comment from the back row: Some people will want automatic conversions. Some people will want a compilation failure. Both are perfectly reasonable behaviors, and which one is appropriate is project specific.
If (either) units library fails to provide both capabilities, it will be unusable for some category of projects.
I don't know how to control this, nor what the interface should look like, but I am certain that a good units library will be able to go both ways.
BTW what is wrong with a nocast(t) scheme ? regards Andy Little