|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50244 - trunk/boost/units
From: steven_at_[hidden]
Date: 2008-12-11 16:00:17
Author: steven_watanabe
Date: 2008-12-11 16:00:17 EST (Thu, 11 Dec 2008)
New Revision: 50244
URL: http://svn.boost.org/trac/boost/changeset/50244
Log:
Pathscale seems to ignore the inheritence from power_typeof_helper. Use forwarding functions instead.
Text files modified:
trunk/boost/units/pow.hpp | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
Modified: trunk/boost/units/pow.hpp
==============================================================================
--- trunk/boost/units/pow.hpp (original)
+++ trunk/boost/units/pow.hpp 2008-12-11 16:00:17 EST (Thu, 11 Dec 2008)
@@ -60,9 +60,14 @@
/// raise @c float to a @c static_rational power
template<long N,long D>
struct power_typeof_helper<float, static_rational<N,D> >
- : power_typeof_helper<double, static_rational<N,D> > {
- typedef typename power_typeof_helper<double, static_rational<N,D> >::type type;
- using power_typeof_helper<double, static_rational<N,D> >::value;
+{
+ // N.B. pathscale doesn't accept inheritence for some reason.
+ typedef power_typeof_helper<double, static_rational<N,D> > base;
+ typedef typename base::type type;
+ static type value(const double& x)
+ {
+ return base::value(x);
+ }
};
#endif
@@ -87,11 +92,15 @@
/// take @c static_rational root of an @c T
template<class T, long N,long D>
-struct root_typeof_helper<T,static_rational<N,D> >
- : power_typeof_helper<T, static_rational<D,N> > {
- // help pathscale?
- typedef typename power_typeof_helper<T, static_rational<D,N> >::type type;
- using power_typeof_helper<T, static_rational<D,N> >::value;
+struct root_typeof_helper<T,static_rational<N,D> >
+{
+ // N.B. pathscale doesn't accept inheritence for some reason.
+ typedef power_typeof_helper<T, static_rational<D,N> > base;
+ typedef typename base::type type;
+ static type value(const T& x)
+ {
+ return(base::value(x));
+ }
};
#endif
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk