Boost logo

Boost :

From: Eric Ford (eford_at_[hidden])
Date: 2001-09-24 02:16:05


> An unit problem was that of units that look dimensionally identical,
but
> have different semantics, like regular numbers v. radians v.
steradians.
> Maybe that problems could be solved with another template parameter,
a
> value-based template parameter of type const char *. Global strings
(char
> arrays) can be used as template parameters; we could use the empty
string
> ("") as the 'default' unit of that dimension, if any, and use other
strings
> for variant units.

I don't understand what the benefit would be. I certainly like the
idea of distinguishing between dimensions and units, but I don't see
how using a char array is any better than using a small class serving
either as a tag or maybe carrying some traits-type information. What
am I missing?

Thanks,
E


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