|
Boost : |
From: Eric Ford (eford_at_[hidden])
Date: 2001-10-09 15:28:29
> There is documentation: std_math.html
I haven't looked at the code, but the documentation looks good.
Thanks for doing that.
Am I correct that the next step is to try to persuade people to
provide patches or at least feedback so it can become portable?
I don't understand the pow issue.
What's wrong with something like type promotion often used for the
arithmetic operators?
// tag to indicate power operation
struct pow_tag {};
// declaration of general type promotion class
template< typename Arg1T, typename Arg2T, typename OpT >
struct promote_type;
// specializations for pow
template<typename T> struct promot_type<T,T,pow_tag> { typedef T
return_type; };
template<> struct promot_type<int,float,pow_tag> { typedef float
return_type; };
template<> struct promot_type<float,int,pow_tag> { typedef float
return_type; };
// ...
template<typename BaseT, typename PowerT>
typename promote_type<BaseT,PowerT,pow_tag>::return_type
pow(BaseT x, PowerT a);
BTW- It might be nice if we used a general type promotion framework.
Is someone working on that? If so, what's the status? Is there a
working version we could use? If not, we could modify the
unit_promotion code I posted in qualified_unit.
E
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk