Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-12 10:21:15


Daniel Frey <daniel.frey_at_[hidden]> writes:

> Hi,
>
> I just had an idea and as I still don't have the time to work on a
> unit-library myself, I'd like to share it with the authors of the
> current libraries. I don't know if it's a stupid idea, but anyway:
>
> Compile-time is an issue. What if the library can be put into a
> check-
> and non-check-mode? During development, I'd use the check-mode to make
> sure that my code is correct. For the release build, I would disable
> all checking as this checking was already done in my debug
> builds. Disableing checking would then not use MPL, all
> units/dimensions are equal and whatever you do it gets accepted. This
> could possibly safe a lot of instantiations, thus both memory and time
> during the compilation. Don't know if it's worth the effort, but as I
> said, it's just an idea.

IIUC, most people do that with preprocessor switches that turn
typedefs for common quantities like "meter" into simple doubles or
floats. Generally the compiler can handle these much more
efficiently than any class instance.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk