.template?

Im implementing a template class. I created a tem.template class to implement it im using Microsoft visual c++ but all my code looks black no colors like when i write in .h or .cpp is it normal? Or is not recognizing the .template?
Last edited on
.template is not a standard extension, so it's just not applying any syntax coloring. Why not just use the .h extension?
because i already have my class .h
so the implementations should be .cpp


but because i am using template class I have to create a class .h
and the implementation should be .template that is according the book
.h is the extension for header files. Classes are data structures, not files

If your book says that template classes must be implemented in .template files I suggest you to burn the book and beat up the writer
Last edited on
jajaja ok I might be wrong, Ill read it again thanks
Ok, now for a serious post, I think I understand that you already have an header where you declared you template class
All you have to do to implement that class is creating a .cpp file, include the header where the class is declared, and implement the methods of the class
I'm guessing that you're trying something like this:

1
2
class tem {};
tem.template();


A template class should look like this:
1
2
3
4
5
6
template <class T> 
class tem
{
};

tem<int> MyObject;


Last edited on
thank you
Topic archived. No new replies allowed.