Boost logo

Boost :

From: Jan Langer (jan_at_[hidden])
Date: 2004-01-06 17:37:13


i changed the subject line due to david abrahams comment.

Andy Little wrote:
> But because they are names they are more versatile:
> A simple metaprogramming class
> template< int x>
> struct Rep{
> const static int value = x; // notably 'static' Therefore I do not
> need a class object to get at this name
> };

but isnt this exactly the purpose of mpl's integral_c type? and if you
use a type as the representation of the dimensions power you can use it
like:
        abstract_pq <integral_c <int, 0>, ...>

and because this is too verbose there might exist a short form
        abstract_pq_c <int, 0, 1, -2, ...>

and now you have nearly the same as mpl's vector. so why not use it
directly. another advantage is that you can use a compile time rational
  type interchangeable. also some future user can use a type called
        real <pi> or complex <3, 4>
as a power of your dimensions. if this makes sense, i cannot answer.

> Yep ... Dont have a clue what this SIUnits syntax is about:
> Length L = 5 * meters ;
> I tend to assume that operator * means multiply... Nope apparently not in
> SIUnits.

i do not really know what you mean, but 5 * meter(s) looks very natural
to me. a scalar factor 5 is multiplied to a length of a meter, which
results in a length of 5 meters. if you have an implicit value_type and
if you assume to be solely in a specific units system, the syntax
        length l = 5*meters;
expresses all facts.

> (the pq_ prefix is designed to reduce name collisions)

you should consider using namespaces ;-)
it'll be needed anyway for a submission to boost.

jan

-- 
jan langer ... jan_at_[hidden]
"pi ist genau drei"

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