Bitwise logic gmpxx.h problems

Torbjorn Granlund tg at swox.com
Thu Jul 24 20:26:34 CEST 2008


Joppe Bos <jwbos at science.uva.nl> writes:

  I am not an experienced C++ hacker but the problem of these
  compiler errors are the following lines in gmpxx.h:
  
  __GMPP_DECLARE_COMPOUND_OPERATOR(operator&=)
  __GMPP_DECLARE_COMPOUND_OPERATOR(operator|=)
  __GMPP_DECLARE_COMPOUND_OPERATOR(operator^=)
  
  __GMPZZ_DEFINE_COMPOUND_OPERATOR(operator&=, __gmp_binary_and)
  __GMPZZ_DEFINE_COMPOUND_OPERATOR(operator|=, __gmp_binary_ior)
  __GMPZZ_DEFINE_COMPOUND_OPERATOR(operator^=, __gmp_binary_xor)
  
  Replacing the double PP and ZZ by single ones solves the problem.

Do you base this on experiments, or on analysis from reading the code?

There ought to be a reason for the ZZ variant, they are used just for
bitwise ops.

-- 
Torbjörn


More information about the gmp-bugs mailing list