title: comparing enum from templated class - is it safe?
body: <p>So, a simple question really, illustrated by the example below. When you compile this, the compiler appropriately(?) reports a warning (that we are comparing <code>barfoo&lt;int&gt;::bar</code> with <code>barfoo&lt;foo&gt;::bar</code>), now given <code>bar</code> is an enum - can I safely ignore this warning?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  struct foo
  {
  };
  
  template &lt;typename bob = int&gt;
  struct barfoo
  {
    enum bar { ONE, TWO, THREE };
  
    bar action() const { return TWO; }
  };
  
  template &lt;barfoo&lt;&gt;::bar eAction = barfoo&lt;&gt;::ONE&gt;
  struct IsAction
  {
    template &lt;typename bf&gt;
    static bool check(bf const&amp; cState)
    {
      return cState.action() == eAction;
    }  
  };
  
  int main(void)
  {
    barfoo&lt;foo&gt; c;
  
    cout &lt;&lt; IsAction&lt;&gt;::check(c) &lt;&lt; endl;
  
    return 0;
  }
  </code></pre>
  
  <p>Given I'm a stickler for removing warning messages, is there a way to satisfy the compiler <em>without moving the enum outside</em>?</p>