mardi 2 mai 2017

Cast from object to int loses precision C++

In my TimeCode.h I have following :

inline TimeCode::operator int() const;

Which should be able to execute whenever I cast TimeCode object to int.

But when I do something like :

(int) firstTimeCode > (int) scndTimeCode

The compiler throws the following error at me :

cast from 'TimeCode*' to 'int' loses precision [-fpermissive]

Does anyone know what is the problem and how it can be fixed ? Thank you very much in advance !

Aucun commentaire:

Enregistrer un commentaire