TFitResultPtr is pointer to a class and should not be cast into an int. See its usage for instance here.