# HG changeset patch # User klao # Date 1138887781 0 # Node ID 08834607d4db8eb2c85e97fdefd5cf8836ad427b # Parent 9fe177e0437db712187af18949049a498bafc912 kruskal.h: an overloaded function for older, pointer-style iterators diff -r 9fe177e0437d -r 08834607d4db lemon/kruskal.h --- a/lemon/kruskal.h Thu Feb 02 08:52:20 2006 +0000 +++ b/lemon/kruskal.h Thu Feb 02 13:43:01 2006 +0000 @@ -18,8 +18,9 @@ #define LEMON_KRUSKAL_H #include +#include #include -#include +#include /** @defgroup spantree Minimum Cost Spanning Tree Algorithms @@ -315,7 +316,7 @@ mutable Iterator it; public: - typedef typename Iterator::value_type Key; + typedef typename std::iterator_traits::value_type Key; typedef bool Value; KruskalSequenceOutput(Iterator const &_it) : it(_it) {} @@ -415,8 +416,6 @@ kruskal(const GR& g, const IN& in, RET out, - //,typename RET::value_type = typename GR::Edge() - //,typename RET::value_type = typename RET::value_type() const typename RET::value_type * = (const typename RET::value_type *)(0) ) @@ -425,6 +424,18 @@ return kruskal(g, KruskalMapInput(g, in), _out); } + template + inline + typename IN::Value + kruskal(const GR& g, + const IN& in, + RET *out + ) + { + KruskalSequenceOutput _out(out); + return kruskal(g, KruskalMapInput(g, in), _out); + } + /// @} } //namespace lemon