How to check/find if an item is in a DEQUE
In the code above the else-if part gives me error. The meaning of else-if is: ***else if the value of x isn't in the deque then...***
 
    #include <iostream>
    #include <ctime>
    #include <stack>
    #include <deque>
    #include <algorithm>
    deque<char> visited;
    char x;
    
       if (x==target[4][4])
       {
               visited.push_back(x);			
               return (visited);
       }
       else if (find(visited.begin(), visited.end(), x))
       {
    	   visited.push_back(x);
       }

How to check/find if an item is in a DEQUE
===

In the code above the else-if part gives me error. The meaning of else-if is: ***else if the value of x isn't in the deque then...***
 
    #include <iostream>
    #include <ctime>
    #include <stack>
    #include <deque>
    #include <algorithm>
    deque<char> visited;
    char x;
    
       if (x==target[4][4])
       {
               visited.push_back(x);			
               return (visited);
       }
       else if (find(visited.begin(), visited.end(), x))
       {
    	   visited.push_back(x);
       }
