Boost logo

Boost :

Subject: Re: [boost] [accumulator][geometry][units] Vector Class
From: Matthias Schabel (boost_at_[hidden])
Date: 2010-05-19 15:16:31

> I imagine that using geometry/unit together will be common.
> I just posted these files on boost-user too, but I wanted the geometry/units developers to see what I've done.
> I think it was too difficult to make a Vector<quantity<U,T>> class.
> However, it could be done, so that is very good!
> The problem is that the geometry library assumes that the types of T*T and sqrt(T) is the same as T.

This is a common problem (even for std::complex, though the spec disallows UDTs anyway...) - the accumulator and uBLAS libraries also have this problem because they do not correctly compute return types for UDTs. If the authors of any and/or all of those libraries (or some other interested parties) were interested in modifying them to fix this issue, it would probably make sense to refactor the boost/units/operators.hpp header into a more general segment of Boost to provide the operator_typeof_helper classes on a more general basis...


Boost list run by bdawes at, gregod at, cpdaniel at, john at