Boost logo

Boost :

From: Aristid Breitkreuz (aribrei_at_[hidden])
Date: 2007-01-20 14:27:25


Am Samstag, den 20.01.2007, 11:35 -0700 schrieb Matthias Schabel:
> Hi Aristid,
>
> > Worse, I think you can't fix the set of currencies at compile-time.
> > Even
> > if you were willing to change your program whenever a new currency is
> > added to the set of world currencies (admittedly relatively rarely but
> > it does happen), you might quickly want to add stuff like wheat or
> > stocks (if only for completeness sake).
> >
> > Any ideas how to deal with this properly?
>
> I really don't know of a way (at least in C++) to provide zero overhead
> compile-time dimensional analysis where you don't specify the set of
> currencies in advance.

Well... they all share the "price" dimension, right?

> mcs::units allows arbitrary (or nearly so)
> unit conversions
> at runtime, but is restricted to a static set of fundamental units
> (whatever they
> may be).

Like I feared.

> The kind of application you're envisioning probably calls for a
> runtime system or (even better) a specific library for dealing with
> currency...

Well I'm not actually having a specific application in mind. It's just
that I'm currently writing an application that deals with money and I
read Yuval's post...

So you think mcs::units cannot possibly support run-time currencies in
the near and far future?

>
> Matthias

Aristid


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