Question: bool criterion3 (vector w) { if (w.empty()) return false; int i = 0; // first characters int j = w.size() - 1; // last character

bool criterion3 (vector w) { if (w.empty()) return false;

int i = 0; // first characters int j = w.size() - 1; // last character

while (i < j) { if (w[i]!=w[j]) { return false; } i++; j--; } return true; }

I created a class (Word) and we were asked to implement it using this bool criterion3 (vector w) to search for words in a file and check if its palindrome or not but it's giving me this Error. [Error] no match for 'operator!=' (operand types are 'Word' and 'Word'), [Note] template argument deduction/substitution failed, [Note] 'Word' is not derived from 'const std::pair<_T1, _T2>'. Please Help.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!