diff --git a/graph.hpp b/graph.hpp index 8869830..1796d79 100644 --- a/graph.hpp +++ b/graph.hpp @@ -67,8 +67,8 @@ public: // Modifiers bool addVertex(const_reference data); bool removeVertex(const_reference data); - bool addEdge(const_reference source, const_reference destination, float weight = 0); - bool removeEdge(const_reference source, const_reference destination, float weight = 0); + bool addEdge(const_reference source, const_reference destination, E weight = 0); + bool removeEdge(const_reference source, const_reference destination, E weight = 0); bool removeAllEdges(const_reference source, const_reference destination); // Lookup @@ -77,7 +77,7 @@ public: std::vector neighboursOf(const_reference data) const; /// @todo come up with a more clear name - std::vector edgesBetween(const_reference source, const_reference destination) const; + std::vector edgesBetween(const_reference source, const_reference destination) const; std::vector edges() const; // iterators @@ -437,7 +437,7 @@ inline bool Graph::removeVertex(const_reference data) } template -bool Graph::addEdge(const_reference source, const_reference destination, float weight) +bool Graph::addEdge(const_reference source, const_reference destination, E weight) { typename std::vector::iterator source_it = find(source); if (source_it == m_vertices.end()) @@ -455,7 +455,7 @@ bool Graph::addEdge(const_reference source, const_reference destina } template -inline bool Graph::removeEdge(const_reference source, const_reference destination, float weight) +inline bool Graph::removeEdge(const_reference source, const_reference destination, E weight) { typename std::vector::iterator source_it = find(source); if (source_it == m_vertices.end()) @@ -518,9 +518,9 @@ std::vector::pointer> Graph::neighbours } template -std::vector Graph::edgesBetween(const_reference source, const_reference destination) const +std::vector Graph::edgesBetween(const_reference source, const_reference destination) const { - std::vector retval; + std::vector retval; typename std::vector::const_iterator vertex_it = find(source); if (vertex_it == m_vertices.end()) return retval;