|
Boost : |
From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-04-27 14:39:28
>From: <renej_at_[hidden]>
> > However, I then realised that all this metaprogramming complexity would
> > probably have quite a price, for more elaborate computations. It could
> > increase the compilation time, for a flexibility that might not be
> > used.
>
> and that's what we face every day: huge compilation times because of
> templates; so, minimizing this is indeed something to consider
> OTOH, computers get faster and faster
Yeah, I thought of that, too.
> > Even if angle is added as a dimension, to an implementation using an
> > integer vector, it still wouldn't accommodate any other dimensions
> > added later, without rewriting the library and unit definitions.
>
> how about having the basic SI dimensions and a couple of extra
> "to-be-defined-by-the-developer" dimensions. In that case, full
> SI "compliance" and for those who want something extra they can have
> it. I saw one of the discussed unit libraries provided something
> like a dimension to be defined by the user/developer.
Yes, Eric Ford's SI units library
(http://article.gmane.org/gmane.comp.lib.boost.devel/17377) uses this
approach, providing two more "custom dimensions" in additional to the seven
SI ones. The question is, what if the user wants a third extra dimension?
Providing any fixed number of dimensions means that it may become too
little, or unused flexibility (especially if the user has to supply
"default" values for any unused dimensions, when defining new ones).
Regards,
Terje
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk