
29 Mar
2007
29 Mar
'07
2:59 p.m.
Steven Watanabe wrote:
One concern I have, is that I use a lot of C++ wrappers over legacy C libraries such as CLAPACK and ATLAS.
<snip>
If you are doing that I would put the assertion at the point where you cast.
The only problem with that is it would require a separate check for all different types of units in use, even though each check was conceptually doing the same thing. I guess it would be a simple matter for the user to derive a new template from quanity<Q,T> for the sole purpose of adding the static assert, so perhaps the library itself doesn't need to be concerned with this. -Lewis