title: How do I compare two generic types in C++?
body: <p>I need to determine whether an element is the same as the one I'm passing by reference.
  In the function <code>Belongs</code> I need to compare equality between <code>d</code> is and an element of a stored in a dynamic list:</p>
  
  <pre><code>struct Nodo{ Dominio dominio; Rando rango; Nodo* next; }; 
  typedef Nodo* ptrNodo; 
  ptrNodo pri; 
  
  template&lt;class Dominio, class Rango&gt;
  bool DicListas&lt;Dominio,Rango&gt;::Belongs(const Dominio &amp;d)
  {
    bool retorno = false;
    if(!EsVacia())
    {
      ptrNodo aux=pri;
  
      while(aux!=NULL)
      {
        if(aux-&gt;dominio==d)//-------&gt; THIS CLASS DOESN'T KNOW HOW TO COMPARE THE TYPE DOMINIO.
        {
          retorno = aux-&gt;isDef;
        }
        aux = aux-&gt;sig;
      }
    }
    return retorno;
  }
  </code></pre>