diff -r dff32ce3db71 -r d3dcc49e6403 lemon/insertion_tsp.h --- a/lemon/insertion_tsp.h Sun Jan 09 15:06:55 2011 +0100 +++ b/lemon/insertion_tsp.h Thu Feb 28 17:13:14 2013 +0100 @@ -203,12 +203,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(_tour.begin(), _tour.end()); + template + void tourNodes(Iterator out) const { + std::copy(_tour.begin(), _tour.end(), out); } /// \brief Gives back the found tour as a path.