templates again

Alright, I'm working on a templates project. And man does it suck.

I keep getting the error: ISO C++ forbids declaration of `(blah)' with no type

And it makes no sense to me. I don't see the need to post any code, unless someone deems it necessary.

Thanks.
I assume you have some sort of class that uses a template:

1
2
3
4
5
6
template <class T>
class MyClass {
   // ... blah blah blah ...
   // maybe something that depends on the template
   T data;
};


Then, whenever you want an object of type MyClass, you need to say:

1
2
3
4
5
6
7
int main() {
   // ... blah blah blah ...
   MyClass<int> myIntObj;
   MyClass<double> myDoubleObj;
   MyClass<MyOtherClass> myOtherClassObj;
   // ... etc etc etc ...
}


If this is not your problem, you'll probably need to post the section of code which generates this error.
Topic archived. No new replies allowed.