Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-04-27 12:01:14

>From: "Pavel Vozenilek" <pavel_vozenilek_at_[hidden]>

> "Terje Slettebø" <tslettebo_at_[hidden]> wrote in message
> news:01fe01c30ca7$1aa134b0$8d6c6f50_at_pc...
> > If one were to implement currency conversion, how might that be done, in
> > general?
> >
> > Does one need to store the conversion rates between any two currencies
> > (giving an N^2 size table), or might it be possible to convert any
> currency
> > to some "universal currency", and from that again to any other, and
> > getting the right values (giving a 2N table)?
> >
> Currency conversion as drop-in library is IMHO not possible - currencies
> differ from strict units like weight and future applications may require
> functionality beyond current requirements.

Well, your library is very general, where you provide conversion functions
between any two types. If you define each currency as a type, wouldn't this
cover the functionality for converting between currencies? If not, what
could be needed?

I realise that in this case, it may be a lot of functions to define, to
define the conversion between any two currencies - for e.g. 20 currencies,
that's around 400 functions to define. I meant if it theoretically would be
possible for your library, since you say you think it's not possible for a
"drop-in library" (what is meant by that?).



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