I\'m trying to overload the dereference operator, but compiling the following code results in the error \'initializing\' : cannot convert from \'X\' to \'int\':
\'initializing\' : cannot convert from \'X\' to \'int\'
You're dereferencing a pointer to X. Your class is OK (as far as it's implemented).
X
int main() { X x; // no pointer int t = *x; // x acts like a pointer }