Variadic function for multiplications with mpz_t

Hans Aberg haberg-1 at telia.com
Mon Jan 12 22:22:26 UTC 2015


> On 12 Jan 2015, at 17:43, Marc Glisse <marc.glisse at inria.fr> wrote:
> 
> On Mon, 12 Jan 2015, Torbjörn Granlund wrote:

>> Or is there another solution?
> 
> Use C++ instead ;-)

C++11 is rather stable at this point, and compilers optimize fairly aggressively. For example, a class with move assignment/constructor, e = a*b + c*d in Clang of OS X 10.10.2 seems to invoke only one move (no copying); if I write the operations out:
  a*b
  c*d
  a*b + c*d
  e = std::move(a*b+c*d)




More information about the gmp-discuss mailing list