title: Doing enum cast to int
body: <p>I've a problem on this code:</p>
  
  <pre><code>template &lt;typename T&gt;
  void dosth(T&amp; value,const T&amp; default_value)
  {
     if (condition)
         value = 10;
     else
         value = default_value;
  }
  </code></pre>
  
  <p>When I call that with</p>
  
  <pre><code>enum {
      SITUATION1,
      STIUATION2
  };
  
  int k;
  dosth(k,SITUATION1);
  </code></pre>
  
  <p>the compiler (g++ 4.5) says</p>
  
  <blockquote>
    <p>no matching function for call to 'dosth(int&amp;,)'</p>
  </blockquote>
  
  <p>Why doesn't the compiler automatically cast the enum into an int?</p>