[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
PATCH: ghs workaround
- To: VSIPL++ Developers List <vsipl++@xxxxxxxxxxxxxxxx>
- Subject: PATCH: ghs workaround
- From: Stefan Seefeld <stefan@xxxxxxxxxxxxxxxx>
- Date: Fri, 18 Nov 2005 09:31:19 -0500
It appears ghs didn't like the way I used a template default argument
to combine a unary functor and a binary functor into one.
This patch separates both, and makes ghs happy.
Regards,
Stefan
Index: src/vsip/complex.hpp
===================================================================
RCS file: /home/cvs/Repository/vpp/src/vsip/complex.hpp,v
retrieving revision 1.7
diff -u -r1.7 complex.hpp
--- src/vsip/complex.hpp 17 Nov 2005 12:58:39 -0000 1.7
+++ src/vsip/complex.hpp 18 Nov 2005 14:28:16 -0000
@@ -79,14 +79,19 @@
namespace impl
{
-// Make this class usable as a binary as well as unary functor
-template <typename T1, typename T2 = T1>
+template <typename T>
+struct realtocomplex_functor
+{
+ typedef complex<T> result_type;
+ static result_type apply(T rho) { return complex<T>(rho);}
+ result_type operator() (T rho) const { return apply(rho);}
+};
+
+template <typename T1, typename T2>
struct polartorect_functor
{
typedef typename Promotion<complex<T1>, complex<T2> >::type result_type;
- static result_type apply(T1 rho) { return complex<T1>(rho);}
static result_type apply(T1 rho, T2 theta) { return polar(rho, theta);}
- result_type operator() (T1 rho) const { return apply(rho);}
result_type operator() (T1 rho, T2 theta) const { return apply(rho, theta);}
};
@@ -116,10 +121,10 @@
template <typename, typename> class const_View,
typename Block0>
inline const_View<complex<T>,
- impl::Unary_func_view<impl::polartorect_functor, T> >
+ impl::Unary_func_view<impl::realtocomplex_functor, T> >
polartorect(const_View<T, Block0> rho) VSIP_NOTHROW
{
- return impl::Unary_func_view<impl::polartorect_functor, T>::apply(rho);
+ return impl::Unary_func_view<impl::realtocomplex_functor, T>::apply(rho);
}
template <typename T1, typename T2>
|