Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2007-01-19 22:28:05


> However, assuming that a quantity<D,T> looks like a T in memory,
> reinterpret_cast should Just Work. Of course, it would let you
> change both D

This is true and, since this is strictly a runtime library,
quantity<D,T> will just be
a T in memory, so a special reinterpret cast is probably not
necessary...

> and T. (My thought was to have a cast that can change quantity<D,T>
> to and
> from a T.)

As Andrey points out, conversion to T can be through the value()
member function
and conversion from T via explicit constructor specifying the
dimensions, so any
cast would be redundant. That said, I don't mind a little redundancy
if it increases
transparency...

Matthias


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