[GiNaC-devel] rotate_left() in ex.h => compilation failure

Alexei Sheplyakov varg at theor.jinr.ru
Tue Mar 4 17:47:03 CET 2008


Hi!

I've tried to compile a library using GiNaC (version 1.3) with GiNaC version
1.4. Compilation failed because ex.h defines `rotate_left' function: 

55 /** Rotate bits of unsigned value by one bit to the left.
56   * This can be necesary if the user wants to define its own hashes. */
57 inline unsigned rotate_left(unsigned n)
58 {
59         return (n & 0x80000000U) ? (n << 1 | 0x00000001U) : (n << 1);
60 }

The library in question has a function 

static inline double rotate_left(double x, int i = 1)

so the code like

double x = rotate_left(5);

fails to compile due to ambigously overloaded function.

I think this is GiNaC's fault -- having such a helper function in a *public*
header is not a good idea. So, I'd like to move it (say, to utils.h).
Any objections?

Best regards,
	Alexei

-- 
All science is either physics or stamp collecting.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-devel/attachments/20080304/e3d29430/attachment.sig 


More information about the GiNaC-devel mailing list