template <class node_type, class edge_type>
class CSparseGraph
{
public:
typedef edge_type EdgeType;
typedef node_type NodeType;
typedef std::vector<node_type> NodeVector;
typedef std::list<edge_type> EdgeList;
typedef std::vector<EdgeList> EdgeListVector;
private:
NodeVector m_Nodes;
EdgeListVector m_Edges;
bool m_Digraph;
int m_NextNodeIndex;
public:
CSparseGraph(bool Digraph):m_NextNodeIndex(0),m_Digraph(Digraph){ }
.
.
int NumEdges() const
{
int tot = 0;
for (EdgeListVector::const_iterator curEdge = m_Edges.begin(); curEdge != m_Edges.end(); curEdge++)
{
tot += curEdge->size();
}
return tot;
}
.
.
};
C++ template code not compiling on linux (const_iterator)
Hi Guys,
I am having a problem getting some C++ code to compile on Linux. The following code compiles fine on Visual Studio 2005 on my Windows XP box but not on Code::Blocks on my Ubuntu desktop 7.10 system. I have bolded the part that seems to be causing the problem. The error message given is "error: expected ';' before 'curEdge'" Can anyone help?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement