Why isn't the == operator getting properly overloaded (so that it can only return true
)? I've tried without *
but it does not help.
#include "stdafx.h"
#include <iostream>
class alfa
{
public:
int x;
bool operator == (alfa * &f)
{
return true;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
//alfa alfa2;
alfa * tab[2];
tab[0] = new alfa;
tab[1] = new alfa;
if(tab[0] == tab[1])
{
std::cout << "tak";
}
scanf("%d");
}