Basically, I probably did something wrong. And Visual Studio is yelling at me and I am like a deaf person who is just sitting there while being yelled at and thinking: "What do you want from me?". Anyways I have narrowed it down to a single if statement:
for (int i = 0; i < countries.size(); i++) {
for (int x = 0; x < countries.size(); x++) {
if (countries[i].thoughtsof[x] < -50) {
for (int v = 0; v < currentwars.size(); v++) {
if ( (std::find(currentwars[v].Agressors.begin(), currentwars[v].Agressors.end(), countries[i]) != currentwars[v].Agressors.end() || std::find(currentwars[v].Defenders.begin(), currentwars[v].Defenders.end(), countries[i]) != currentwars[v].Defenders.end()) && (std::find(currentwars[v].Agressors.begin(), currentwars[v].Agressors.end(), countries[x]) != currentwars[v].Agressors.end() || std::find(currentwars[v].Defenders.begin(), currentwars[v].Defenders.end(), countries[x]) != currentwars[v].Defenders.end()) ) {
result = true;
}
else {
result = false;
}
if (!result) {
War war(countries[i], countries[x]);
currentwars.push_back(war);
}
}
}
}
}
The error is basically saying: "binary '==': no operator found which takes a left-hand operand of type 'Country' (or there is no acceptable conversion)"
Double clicking on it refers me to this block:
template<class _InIt,
class _Ty> inline
_InIt _Find_unchecked1(_InIt _First, _InIt _Last, const _Ty& _Val, false_type)
{ // find first matching _Val
for (; _First != _Last; ++_First)
if (*_First == _Val)
break;
return (_First);
}
But, in War class header I have set both vectors as Country ones:
std::vector<Country> Agressors;
std::vector<Country> Defenders;
Excuse me if I formated something not too good. It is just that I am slowly going into insanity as I am trying to fix this for 2 days. Thanks in advance.