Sample C++ source code to illustrate problem that g++ 2.8.0 has with templates
g++-2.8.0 has problems compiling templatized classes with arbitrary number
of parameters. It is a problem with the compiler. Here is an ultra short
example we cooked up to illustrate this point.
// A sample of why TyVIS won't compile with g++ 2.8.0
#include < iostream.h >
#include < stdarg.h >
template < class T >
class TestClass {
public:
TestClass() {}
~TestClass() {}
int manyParameters(int paramCount, ...);
};
template < class T >
int
TestClass < T > ::manyParameters(int paramCount, ...) {
va_list ap;
int tempInt;
va_start(ap, paramCount);
for(int i = 0; (i < paramCount); i++) {
tempInt = va_arg(ap, int);
cout << "Parameter " << (i + 1) << " was = " << tempInt << endl;
}
va_end(ap);
return 0;
}
main() {
TestClass < int > t;
t.manyParameters(3, 1, 2, 3);
}
SAVANT, version 1.02
savant@ece.uc.edu