|
Boost : |
From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2005-02-01 23:52:13
Matt Austern writes:
> There's actually something even lower level than a dimension library.
> In essence, what we've got is:
> - We're generalizing the notion of an arithmetic type T to a type of
> the form <T,X>, where X is some sort of tag.
> - For any X1 and X2 and any arithmetic operation 'op', we have rules
> for whether <T,X1> op <T,X2> is well defined. If it is then the
> result is tagged as <T,X3>, and we have rules to determine X3 in terms
> of X1, X2, and op.
That's basically what we have here at Meta. Low-profile, but extremely
useful. FWIW, ours is spelled as 'scalar_type<T,X>'.
>
> All of the knowledge about how to represent dimensional systems (mpl
> vectors, compile-time fractions, etc.) is higher level than this.
Yep.
-- Aleksey Gurtovoy MetaCommunications Engineering
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk