diff --git a/Examples/test-suite/template_typedef.i b/Examples/test-suite/template_typedef.i index 1d58d53bd..1891e711b 100644 --- a/Examples/test-suite/template_typedef.i +++ b/Examples/test-suite/template_typedef.i @@ -70,8 +70,8 @@ typedef float argument_type; typedef float result_type; - static const char* const arg_type = "float"; - static const char* const res_type = "float"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -80,8 +80,8 @@ typedef real argument_type; typedef real result_type; - static const char* const arg_type = "real"; - static const char* const res_type = "real"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -89,8 +89,8 @@ { typedef float argument_type; typedef real result_type; - static const char* const arg_type = "float"; - static const char* const res_type = "real"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -98,8 +98,8 @@ { typedef float argument_type; typedef real result_type; - static const char* const arg_type = "float"; - static const char* const res_type = "real"; + static const char* const arg_type; + static const char* const res_type; }; template @@ -114,8 +114,25 @@ typename arith_traits< RF, RG >::result_type>(); } +#ifndef SWIG + + // Initialize these static class members + + const char* const arith_traits< float, float >::arg_type = "float"; + const char* const arith_traits< float, float >::res_type = "float"; + + const char* const arith_traits< real, real >::arg_type = "real"; + const char* const arith_traits< real, real >::res_type = "real"; + + const char* const arith_traits< real, float >::arg_type = "float"; + const char* const arith_traits< real, float >::res_type = "real"; + + const char* const arith_traits< float, real >::arg_type = "float"; + const char* const arith_traits< float, real >::res_type = "real"; + +#endif + } - %} namespace vfncs { diff --git a/Examples/test-suite/template_typedef_cplx.i b/Examples/test-suite/template_typedef_cplx.i index 104e59910..2dc962c88 100644 --- a/Examples/test-suite/template_typedef_cplx.i +++ b/Examples/test-suite/template_typedef_cplx.i @@ -73,8 +73,8 @@ typedef std::complex cmplx; typedef double argument_type; typedef double result_type; - static const char* const arg_type = "double"; - static const char* const res_type = "double"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -83,8 +83,8 @@ typedef std::complex cmplx; typedef Complex argument_type; typedef Complex result_type; - static const char* const arg_type = "complex"; - static const char* const res_type = "complex"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -92,8 +92,8 @@ typedef std::complex cmplx; { typedef double argument_type; typedef Complex result_type; - static const char* const arg_type = "double"; - static const char* const res_type = "complex"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -101,8 +101,8 @@ typedef std::complex cmplx; { typedef double argument_type; typedef Complex result_type; - static const char* const arg_type = "double"; - static const char* const res_type = "complex"; + static const char* const arg_type; + static const char* const res_type; }; template @@ -116,6 +116,25 @@ typedef std::complex cmplx; ArithUnaryFunction::argument_type, typename arith_traits< RF, RG >::result_type>(); } + +#ifndef SWIG + + // Initialize these static class members + + const char* const arith_traits< double, double >::arg_type = "double"; + const char* const arith_traits< double, double >::res_type = "double"; + + const char* const arith_traits< Complex, Complex >::arg_type = "complex"; + const char* const arith_traits< Complex, Complex >::res_type = "complex"; + + const char* const arith_traits< Complex, double>::arg_type = "double"; + const char* const arith_traits< Complex, double >::res_type = "complex"; + + const char* const arith_traits< double, Complex >::arg_type = "double"; + const char* const arith_traits< double, Complex >::res_type = "complex"; + +#endif + } %} diff --git a/Examples/test-suite/template_typedef_cplx2.h b/Examples/test-suite/template_typedef_cplx2.h index df19e5ad6..8a0578d8d 100644 --- a/Examples/test-suite/template_typedef_cplx2.h +++ b/Examples/test-suite/template_typedef_cplx2.h @@ -66,8 +66,8 @@ namespace vfncs { { typedef double argument_type; typedef double result_type; - static const char* const arg_type = "double"; - static const char* const res_type = "double"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -76,8 +76,8 @@ namespace vfncs { typedef Complex argument_type; typedef Complex result_type; - static const char* const arg_type = "complex"; - static const char* const res_type = "complex"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -85,8 +85,8 @@ namespace vfncs { { typedef double argument_type; typedef Complex result_type; - static const char* const arg_type = "double"; - static const char* const res_type = "complex"; + static const char* const arg_type; + static const char* const res_type; }; template<> @@ -94,8 +94,8 @@ namespace vfncs { { typedef double argument_type; typedef Complex result_type; - static const char* const arg_type = "double"; - static const char* const res_type = "complex"; + static const char* const arg_type; + static const char* const res_type; }; template @@ -109,7 +109,26 @@ namespace vfncs { ArithUnaryFunction::argument_type, typename arith_traits< RF, RG >::result_type>(); } -} + +#ifndef SWIG + +// Initialize these static class members + +const char* const arith_traits< double, double >::arg_type = "double"; +const char* const arith_traits< double, double >::res_type = "double"; + +const char* const arith_traits< Complex, Complex >::arg_type = "complex"; +const char* const arith_traits< Complex, Complex >::res_type = "complex"; + +const char* const arith_traits< Complex, double >::arg_type = "double"; +const char* const arith_traits< Complex, double >::res_type = "complex"; + +const char* const arith_traits< double, Complex >::arg_type = "double"; +const char* const arith_traits< double, Complex >::res_type = "complex"; + +#endif + +} // end namespace vfncs #ifdef SWIG