I am new to stack overflow and I would appreciate feedback. I am creating a template graph class and have split it into two files graph.h and graph.hpp, but everytime I compile I get this error:
In file included from graph.h:97:0,
from main.cpp:2:
graph.hpp:4:26: error: expected unqualified-id before ‘)’ token
typename graph<T>::graph(){
^
makefile:2: recipe for target 'executable.x' failed
Here is my graph.hpp file so far:
#include "graph.h"
//template <typename T>
typename graph<T>::graph(){
numVertices = 0;
graphWeight = 0;
}
And my graph.h file looks something like:
template <typename T>
class graph{
public:
graph();
.
.
.
private:
};
Also, my main.cpp is just simply:
#include "graph.h"
int main(){
graph<int> g;
}
What could possibly be wrong? I know it's probably something simple that has to do with the template.
Thanks