template <class VertexType>
class GraphMatrix
{
};
template <class GraphType>
class Graph
{
typedef typename GraphType::VertexType VertexType;
GraphType* graph_;
void addVertex(VertexType vertex)
{
}
//...
};
int main()
{
Graph <GraphMatrix <int> > graph;
return 0;
}
See if I would add typedef VertexType VertexType;//A
line to GraphMatrix
class
this code will pass compilation and will work, otherwise it gives compile error. Error:C2039: 'VertexType' : is not a member of 'GraphMatrix'. My question is follows 'is there a way (syntax) to make above code work without adding this stupid line //A
'?