Boost logo

Boost :

From: Carlo Wood (carlo_at_[hidden])
Date: 2006-06-08 10:06:47


On Thu, Jun 08, 2006 at 02:49:07PM +0100, Paul Giaccone wrote:
> Does the second officially take any prefix? Can you talk about a
> "megasecond", or would you convert this to the more usual "11 days, 13
> hours, 46 minutes and 40 seconds"? Indeed, does the library have a
> mechanism for doing this sort of breakdown of time? I suspect not, as
> time is not base 10.
>
> Is the litre officially an SI unit? I think I remember reading somewhere
> that either it is not, or it was not but has now been included. In any
> case, it's equivalent to 1/1000 m^3, but this often looks odd when
> referring to liquid, and petrol is sold in litres all over Europe, not
> cubic metres.
>
> The UK tends to use "gram" (like the US) these days rather than
> "gramme", which is a bit old-fashioned. But, again, you might want to
> support both spellings if you give a UK/US spellings option.

Most of this is really just limited to input/output (serialization).
I wouldn't object to a base library that supports the S.I. units,
and calculates in those. The default output should be m^3 (or m3 or whatever)
instead of litre. It would be nice to add conversion possibilities,
like:

  std::cout << pqs::ios::litres << volume;

outputting 'litre' instead of 'm3', but the number of possible
formats are endless, and so are the preferences of different people.

It seems logical to seperate the serialization of the variables from
the library in a way that it becomes very very flexible. Sure, there
should be some acceptable, and mostly scientific correct default,
but you can't expect any user to be satisfied unless they will be
able to implement their own serialization for their own specific case.
(TeX, HTML, chinese, multi-line ASCII, full english, S.I. units, some
other system(!), etc).

-- 
Carlo Wood <carlo_at_[hidden]>

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