On May 30, 6:00 am, "kwikius" <a...@servocomm.freeserve.co.ukwrote:The duration type is pretty much of an exact replica of the quan
quan
http://tinyurl.com/5lxb3s
std
http://tinyurl.com/6k9b7f
hmm... something smells a bit whiffy ..
Sorry, but I don't follow you. What's the relationship between
the two?
quantity.
But.....
From the text the impression one gets is that the design is basically
that of Jeff Garland boost date time lib, with some vague reference
to Walter Brown, presumably SI units library and implementation by
Howard Hinnant.
I believe Walter Brown used compile time rational numbers [1] in
SIUnits, as did Barton & Nackman, but they only used compile time
rationals for dimensional analysis, not conversion factors (meter to
millimeters etc).
The original use of compile time rationals for the units was AFAIK my
pqs library, the forerunner of my quan library in the above link.
(Originally pqs used 2 separate compile time integers, but it was
Brandon Forehand that pointed out that they were in fact acting as a
rational number, and pqs was subsequently modified accordingly).
In fact Mr Garland did use conversion factors in his boost date time
lib, but used runtime scaling (in an explicit ctor at least in
boost_1.33.0), all values were kept internally in milliseconds in a
base class.
Compared with quans method this approach has both a poor range and
loss of precision due to the initial division.
As far as Mr Brown is concerned, he appears until very recently to
have found *problematic*, treating quantities with different
conversion factors as different types (rather than using one type and
doing a runtime scaling, the SIUnits approach).
See wg21 n2526 section 4.1, 4.2 4.3 etc. (Quite a funny read
actually :-))
My guess is that he has been swung around, because in use it is
obvious that the approach used by quan is much superior... the
approach in second link. sorry SIUnits.
I spent a large amount of time working out and arguing for the
approach these guys seem to be taking the credit for between 2003-2007
on boost.org amidst a large amount of naive criticism, and where Mr
Garland is a moderator so IOW he must be familiar with my work. Mr
Garland eventually succeeded in initiating a flame war on boost.org
during middle of which he informed me that he was singling my posts
out for moderation, akin to tieing someones hands behind their back
and slapping them about. At which point I left.
.... hence the source of the smell.
regards
Andy Little
note 1
(Unfortunately I wrongly attributed the origin of compile time
rational to Matthias Schabel in quan-0_2_0), but compile time
rationals appears AFAIK in SIUnits and a physical quantities lib,
ebf_units by Eric Ford around 2003, shortly before my earliset pqs
libray, predecessor to quan.)