title: templates and casting operators
body: <p>This code compiles in CodeGear 2009 and Visual Studio 2010 but not gcc.  Why?</p>
  
  <pre><code>class Foo
  {
  public:
      operator int() const;
  
      template &lt;typename T&gt; T get() const { return this-&gt;operator T(); }
  };
  
  Foo::operator int() const
  {
      return 5;
  }
  </code></pre>
  
  <p>The error message is:</p>
  
  <p>test.cpp: In member function `T Foo::get() const':<br />
  test.cpp:6: error: 'const class Foo' has no member named 'operator T'</p>