title: invalid operands to binary expression ('int_node' and const 'int_node')
body: <p>I'm a C++ beginner, many questions around me. I have defined <code>!=</code> operator of <code>int_node</code>, but when I compile this code, show error:</p>
  
  <blockquote>
    <p>invalid operands to binary expression ('int_node' and const 'int_node')</p>
  </blockquote>
  
  <p>The IDE that I use is xcode 4.6.</p>
  
  <p>Below is my all code </p>
  
  <pre><code>typedef struct int_node{
      int val;
      struct int_node *next;
  } int_t;
  
  template &lt;typename Node&gt;
  struct node_wrap{
      Node *ptr;
  
      node_wrap(Node *p = 0) : ptr(p){}
      Node &amp;operator *() const {return *ptr;}
      Node *operator-&gt;() const {return ptr;}
  
      node_wrap &amp;operator++() {ptr = ptr-&gt;next; return *this;}
      node_wrap operator++(int) {node_wrap tmp = *this; ++*this; return tmp;}
  
      bool operator == (const node_wrap &amp;i) const {return ptr == i.ptr;}
      bool operator != (const node_wrap &amp;i) const {return ptr != i.ptr;}
  } ;
  
  template &lt;typename Iterator, typename T&gt;
  Iterator find(Iterator first, Iterator last,  const T&amp; value)
  {
      while (first != last &amp;&amp; *first != value) // invalid operands to binary experssion ('int_node' and const 'int_node')
      {
          ++first;
          return first;
      }
  }
  
  int main(int argc, const char * argv[])
  {
      struct int_node *list_head = nullptr;
      struct int_node *list_foot = nullptr;
      struct int_node valf;
      valf.val = 0;
      valf.next = nullptr;
      find(node_wrap&lt;int_node&gt;(list_head), node_wrap&lt;int_node&gt;(list_foot), valf);
  
      return (0);
  }
  </code></pre>