Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2003-12-05 13:47:03

> I've finally made time - a milli-fortnight or so ;-) to try this out.

What is that in picoeons?

> I've got your demo to run using MSVC 7.1.

Great. I believe Andy Little also got it to run with VC 7.1 with some
minor mods.
I've already incorporated those in the substantially cleaned up version
I just put up.

> 1 Most files do not end with a newline, after the last line, for
> example:

Pedantic, as you say, but easy to fix.

> 2 There are zillions of signed/unsigned mismatches which can be
> 'cured' by

Hopefully gone in the new version.

> 3 I believe it is more helpful to understand the demo if the units are
> specified
> thus
> using mcs::units::si::_newton;
> using mcs::units::si::_meter;
> using mcs::units::si::_meters; // An alias.

I don't have strong feelings about this either way; if it is generally
accepted Boost
practice to individually alias namespace members, I'm happy to do it
that way.

> 4 I am a little alarmed at the effect of compile time (30 s on my
> semi-senile
> machine), but Intel and AMD are no doubt working on this for us.

I agree - hopefully the compiler geniuses will figure out how to get
MPL to go
a little faster before I need to buy a new system... I also have to
admit that, not
being a computer scientist by trade, it's quite possible that there are
functional but lousy algorithms lurking in my dimensional analysis
It wouldn't be the first time something N^2 crept in where N would do.

> 5 There are a handful of warning that an assignment operator could not
> be
> generated. The MS advice on this is:

If you can give me a more detailed idea of which classes are causing
these problems,
I can add the appropriate operator(s). Much of the code is basically
pure type computation,
so I didn't bother to put in default constructors/destructors/copy
operators, but, again, it's easy to do and harmless.

> 6 I note you are using your 'own' rational. Is there a reason you
> are not
> using the Boost one?

I didn't know that there was an officially sanctioned Boost rational
class (and didn't look
too hard since I had already implemented mine for other purposes before
starting on the
dimensional analysis stuff). Well, now that I look at it, the
boost::rational class is a run-time
rational, not a compile-time rational which is what you need for dim.
analysis. Maybe there
would be some value in a compile-time rational class for Boost?

> 7 The test_dimensional_analysis produced:

> 'c++filt' is not recognized as an internal or external command,
> operable program or batch file.
> But I have yet to even understand what it is expected to do!

Yeah, sorry about that one. GCC outputs mangled typenames when you use
so you need to run a utility called c++filt to demangle them into
something comprehensible by
humans. I've fixed that issue so it only calls c++filt when compiling
with g++ and otherwise
reverts to the basic typeid().name() call...

> Overall, it looks most promising to me, but I want to try to use it
> for real a
> bit more.

Thanks. Please let me know if you run into problems/frustrations.

> Some documentation would be very helpful.

(it's not my day job)^(writing documentation sucks) = (very slow to

Seriously, if you (and any other potential users out there) can give me
a clearer idea which portions of
the library you are most interested in having documented, it's much
more likely to become a

I've also posted a new version of the library in the usual place :

which cleans up some of the inner details and demonstrates creating
hybrid unit systems from
other unit systems. The latter is still very rough around the edges
and I'm not really satisfied with
the way it works at the moment, so feel free to ignore it.


Matthias Schabel, Ph.D.
Utah Center for Advanced Imaging Research
729 Arapeen Drive
Salt Lake City, UT 84108
801-587-9413 (work)
801-585-3592 (fax)
801-706-5760 (cell)
801-484-0811 (home)
mschabel at ucair med utah edu

Boost list run by bdawes at, gregod at, cpdaniel at, john at