diff -r 4bb9e72e1a41 -r 7fdaa05a69a1 lemon/path.h --- a/lemon/path.h Wed Sep 12 17:25:48 2012 +0200 +++ b/lemon/path.h Thu Sep 13 11:56:19 2012 +0200 @@ -64,6 +64,12 @@ /// Default constructor Path() {} + /// \brief Copy constructor + /// + Path(const Path& cpath) { + pathCopy(cpath, *this); + } + /// \brief Template copy constructor /// /// This constuctor initializes the path from any other path type. @@ -73,6 +79,13 @@ pathCopy(cpath, *this); } + /// \brief Copy assignment + /// + Path& operator=(const Path& cpath) { + pathCopy(cpath, *this); + return *this; + } + /// \brief Template copy assignment /// /// This operator makes a copy of a path of any other type. @@ -252,6 +265,12 @@ /// Default constructor SimplePath() {} + /// \brief Copy constructor + /// + SimplePath(const SimplePath& cpath) { + pathCopy(cpath, *this); + } + /// \brief Template copy constructor /// /// This path can be initialized with any other path type. It just @@ -261,6 +280,13 @@ pathCopy(cpath, *this); } + /// \brief Copy assignment + /// + SimplePath& operator=(const SimplePath& cpath) { + pathCopy(cpath, *this); + return *this; + } + /// \brief Template copy assignment /// /// This path can be initialized with any other path type. It just @@ -431,6 +457,12 @@ /// Default constructor ListPath() : first(0), last(0) {} + /// \brief Copy constructor + /// + ListPath(const ListPath& cpath) : first(0), last(0) { + pathCopy(cpath, *this); + } + /// \brief Template copy constructor /// /// This path can be initialized with any other path type. It just @@ -447,6 +479,13 @@ clear(); } + /// \brief Copy assignment + /// + ListPath& operator=(const ListPath& cpath) { + pathCopy(cpath, *this); + return *this; + } + /// \brief Template copy assignment /// /// This path can be initialized with any other path type. It just @@ -758,6 +797,12 @@ /// Default constructor StaticPath() : len(0), arcs(0) {} + /// \brief Copy constructor + /// + StaticPath(const StaticPath& cpath) : arcs(0) { + pathCopy(cpath, *this); + } + /// \brief Template copy constructor /// /// This path can be initialized from any other path type. @@ -773,6 +818,13 @@ if (arcs) delete[] arcs; } + /// \brief Copy assignment + /// + StaticPath& operator=(const StaticPath& cpath) { + pathCopy(cpath, *this); + return *this; + } + /// \brief Template copy assignment /// /// This path can be made equal to any other path type. It simply