Template Member Function Compilation Error on Solaris
Wei Qin
weiqin@gmail.com
Wed Feb 2 07:48:00 GMT 2005
I have some compilation error for one template member function on
solaris g++ 3.3.2. I don't have a problem on x86/linux port of g++.
#include "mpz_base.hpp" // defines _mpz_base_
template <unsigned _Len_, bool _Sign_> class _mpint_t_ {
public:
_mpint_t_() : m() {}
_mpint_t_(const _mpz_base_<_Len_,_Sign_>& v) : m(v) {}
~_mpint_t_() {}
const _mpz_base_<_Len_,_Sign_> val() const {return m;}
// problem here
template <unsigned _L, bool _S> //line 40
void deposit(unsigned lmb, unsigned rmb, const
_mpz_base_<_L,_S> & x) {
m.set_slice(x, lmb-rmb+1, rmb);
}
// line 45
......
};
When compiling, g++ complains
"mpint_type.hpp:40: error: parse error before numeric constant"
"mpint_type.hpp:45: error: semicolon missing after declaration of `
_mpint_t_<_Len_, _Sign_>'
I am been struggling with this problem for a while. Is this a problem
of the compiler or my coding? Experts please advise. Thanks in
advance.
Wei
More information about the Gcc-help
mailing list