When trying to call this function in my code i get the error in the title. Also Operator \'+=\' cannot be applied to the operands of type \'int\' and \'T\'
The error you are getting makes sence. While you call the method with int as the type, the compiler doesn't know that will be the case.
To compile the method as it is, the compiler will need to prove that the operations you do on T will be valid for all T - which is clearly not the case.