
Am Wednesday 26 August 2009 schrieb Manoj Rajagopalan:
Hi UBLAS developers,
I have begun using Boost Units which was introduced in boost v 1.36. I am working on extending UBLAS to support physically dimensioned types and I have provided a short example below.
This can be achieved efficiently if a few extensions to UBLAS type_traits are allowed and I was wondering if anyone would object to this. An example of such an extension would be the introduction of "sqrt_type" as the type for the square root operation. This would be the return type for type_traits<T>::type_sqrt(). For arithmetic types like float and double the template can be partially specialized so that sqrt_type is float or double but for physically dimensioned types like quantity<length,double>, sqrt_type can be set to quantity<length^(1/2), double>.
This is a good idea. Could you prepare a patch and a small example program?
I have already adapted most of vector_expression.hpp for use with these dimensioned quantities with work-arounds for these extensions but this is getting ugly and unwieldy.
is it possible to deduct the square_type from operator*()? E.g., using return type deduction (see detail/returntype_deduction and promote_traits from traits.hpp)
You might also want to get in touch with Steven Watanabe. I believe he has done some work toward making UBLAS and Boost.Units interoperable. Matthias