bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Template bug?


From: Ben Abraham
Subject: Template bug?
Date: Mon, 7 Dec 2009 12:07:08 -0500 (EST)


Ben Abraham
629 East Fifth Street Apt. 20
New York NY 10009


Hi,

There may be bug with respect to templates in g++. The below program does not compile. It may be some silly mistake on my part. I've included the diagnostic and version information respectively.


                              Sincerely,
                              Ben

#include <vector>

using namespace std;

template <class T>
class TTable1 {
  T   fType;
public:
  void debug() {
      vector<T>::iterator it; //this is the line in question (10)
  }
};


int main() {

}


$ g++ testTemplate.cpp
testTemplate.cpp: In member function `void TTable1<T>::debug()':
testTemplate.cpp:10: error: expected `;' before "it"


$ g++ --version
g++ (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


It's cygwin version above running on Windows XP Professional.
Version 5.1 (Build 2600.xpsp.050928-11517 : Service Pack 2 (Windows version)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]