Boost logo

Boost :

From: Phil Richards (news_at_[hidden])
Date: 2004-01-09 06:26:49


On Fri, 09 Jan 2004 01:40:26 -0500, Dan W. wrote:
> Matthias Schabel wrote:
>> These problems go away if you require explicit conversions. [...]
> Amen!

Ditto.

> I've got another reason for wanting no dimension types:
> In a long computation, one may need to store temporaries of unforseen
> dimension types. E.g.: (furlongs/wavenumber)^(-7/11), and store that in a
> named variable. I wouldn't want to declare and name such dimensional type,
> and as far as the unit library's checks for consistency, etc., it
> shouldn't be necessary.

This is fundamentally a bad idea[*], but is achievable in pretty much all
the libraries:
  double tmp = (big complicated expression).get();
(Or equivalent, and probably trying to pick the correct value type, but
you get the idea.)

[*] Why a bad idea? Well, you've lost dimensionality checking in the
middle of the calculation, and if somebody modifies that "complicated
expression" in a way that cocks-up the dimensionality, then you've
lost the whole point of the dimensionality checking library.

phil

-- 
change name before "@" to "phil" for email

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