I've looked through dozens of articles on this site and others and I can't find a single one which addresses this particular issue. Consider this SparseGraph class I'm working on:
Sparse_Graph.h
template <typename NodeType, typename EdgeType>
class SparseGraph
{
//...
public:
SparseGraph();
//...
};
In order to shorten code in my .cpp file, I'm looking to do something similar to:
Sparse_Graph.cpp
#include "Sparse_Graph.h"
template<typename NodeType, typename EdgeType>
using SGraph = SparseGraph<NodeType, EdgeType>;
SGraph::SparseGraph() {}
This is particularly important to me since later on in this file I have a declaration for an iterator function written as:
template <typename NodeType, typename EdgeType>
typename SparseGraph<NodeType, EdgeType>::EdgeIterator&
SparseGraph<NodeType, EdgeType>::EdgeIterator::operator++()
(yeah)
Particularly, the error I get when attempting this is:
invalid use of template-name 'SGraph' without an argument list
So my question is: how can I get this sort of thing to work so I don't have to write 3 line function headers all over my .cpp file?