GCC vs MSVC the Rematch

Comments   1   Date Arrow  October 3, 2005 at 11:41pm   User  by Harry Kalogirou

If you remember from the GCC vs MSVC post, I had a problem with templates and GCC. I looked further in to the problem and I found this on some GCC release notes :

  • You must now use the typename and template keywords to disambiguate dependent names, as required by the C++ standard.

So the problem was the missing typename keyword to be compliant to the standard.

So this code :

template <class C>
void dostuff(C v){
    C::iterator i;
}

Must be turned into this code :

  void dostuff(C v){
      typename C::iterator i;
  }

And GCC is happy as a puppy! I love happy ends…

Digg!
Bookmark this article:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • del.icio.us
  • De.lirio.us
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Reddit
  • Smarking
  • YahooMyWeb

Tagged   Programming

1 Comments

Leave a Comment