bonjour,

J'essaie de surcharger l'opérateur %= avec le code suivant :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
void operator%=(float2& a, const uint& b) {
	a.x %= b ;
	a.y %= b ;
}
mais j'obtiens l'erreur suivante :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
types.hpp: In function ‘void operator%=(float2&, const uint&)’:
types.hpp:60: error: invalid operands of types ‘floatandconst unsigned int’ to binary ‘operator%’
types.hpp:60: error:   in evaluation of ‘operator%=(float, const unsigned int)’
types.hpp:61: error: invalid operands of types ‘floatandconst unsigned int’ to binary ‘operator%’
types.hpp:61: error:   in evaluation of ‘operator%=(float, const unsigned int)
que je n'arrive pas à résoudre.

Quelqu'un aurait-il une suggestion ?