diff -r dff32ce3db71 -r d3dcc49e6403 lemon/greedy_tsp.h
--- a/lemon/greedy_tsp.h Sun Jan 09 15:06:55 2011 +0100
+++ b/lemon/greedy_tsp.h Thu Feb 28 17:13:14 2013 +0100
@@ -206,12 +206,23 @@
/// \brief Gives back the node sequence of the found tour.
///
/// This function copies the node sequence of the found tour into
- /// the given standard container.
+ /// an STL container through the given output iterator. The
+ /// value_type of the container must be FullGraph::Node.
+ /// For example,
+ /// \code
+ /// std::vector nodes(countNodes(graph));
+ /// tsp.tourNodes(nodes.begin());
+ /// \endcode
+ /// or
+ /// \code
+ /// std::list nodes;
+ /// tsp.tourNodes(std::back_inserter(nodes));
+ /// \endcode
///
/// \pre run() must be called before using this function.
- template
- void tourNodes(Container &container) const {
- container.assign(_path.begin(), _path.end());
+ template
+ void tourNodes(Iterator out) const {
+ std::copy(_path.begin(), _path.end(), out);
}
/// \brief Gives back the found tour as a path.