
I don't think I will have time to write a full review of units (and I probably don't know enough to seriously critique it anyway), but FWIW, I think it should be accepted, and it looks quite useful and well designed to me.
Thanks for the support. Please do try to find some time to submit a formal review - it doesn't need to be lengthy, and the more input we get, the better the final outcome (and, in the case of positive votes, the better the chance of acceptance :^).
I did try some quick performance tests out of curiosity on a few different systems. Here is the output of the unit_example_14 test program for:
1) gcc 3.4.4 on WinXP / MinGW (Intel P4 2.8 GHz) ------------------------------------ f(x,y,z) took 6.593 seconds to run 1e+009 iterations with double = 6.06704e+008 flops f(x,y,z) took 10.782 seconds to run 1e+009 iterations with quantity<double> = 3.70989e+008 flops g(x,y,z) took 6.625 seconds to run 1e+009 iterations with double = 6.03774e+008 flops g(x,y,z) took 9.906 seconds to run 1e+009 iterations with quantity<double> = 4.03796e+008 flops
Just for reference, using gcc 4.0.1 on Mac OSX (G5 2GHz) I get no overhead : f(x,y,z) took 4.29 seconds to run 1e+09 iterations with double = 9.32401e+08 flops f(x,y,z) took 4.28 seconds to run 1e+09 iterations with quantity<double> = 9.34579e+08 flops g(x,y,z) took 4.28 seconds to run 1e+09 iterations with double = 9.34579e+08 flops g(x,y,z) took 4.28 seconds to run 1e+09 iterations with quantity<double> = 9.34579e+08 flops Naturally, this library is demanding of the optimizer. I believe someone else has verified that it is possible to achieve zero overhead under Visual C++ 8.0 as well...
I also tried compiling with gcc 3.3.3 but got a large number of errors... I attached the gzipped output in case that is interesting, but maybe this compiler is not supposed to be supported anyway?
We have not attempted to support gcc versions before 3.4.4, and I don't know if it is possible to do it. I'll take a look and see if there's anything obvious. Matthias