Issue in gmpxx.h?

Brian Gladman brg at gladman.plus.com
Tue Oct 19 22:10:41 CEST 2004


Brian Gladman wrote:

 > I have just had an email from a user of my GMP port asking me why line
 > 3181 of gmpxx.h reports:
 >
 > gmp-4.1.4\gmpxx.h(3181) : error C2912: explicit specialization; 'void
 > __gmp_set_expr(mpf_ptr,const mpf_class &)' is not a specialization of a
 > function template
 >
 > with VC++ 7.1.
 >
 > I also noticed this some time ago but I could not see what might be
 > happening.  Can anyone see what is causing this report?

I think I might have found the problem.

In the 'type conversion' section of gmpxx.h there are 21 template 
functions in three groups of 7. In these three groups the first function 
parameters are mpz_ptr, mpq_ptr and mpf_ptr respectively.

But the order of the template declarations in the last group of 7 does 
not match the order in the first 2 groups.  When this group is reordered 
to match the order of the first 2 groups the header then compiles with 
VC++ without problems.

   Brian Gladman



More information about the gmp-discuss mailing list