Changes in / [991:a10624ed1997:989:38e1d4383262] in lemon-main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/path.h
r991 r920 65 65 Path() {} 66 66 67 /// \brief Copy constructor68 ///69 Path(const Path& cpath) {70 pathCopy(cpath, *this);71 }72 73 67 /// \brief Template copy constructor 74 68 /// … … 78 72 Path(const CPath& cpath) { 79 73 pathCopy(cpath, *this); 80 }81 82 /// \brief Copy assignment83 ///84 Path& operator=(const Path& cpath) {85 pathCopy(cpath, *this);86 return *this;87 74 } 88 75 … … 266 253 SimplePath() {} 267 254 268 /// \brief Copy constructor269 ///270 SimplePath(const SimplePath& cpath) {271 pathCopy(cpath, *this);272 }273 274 255 /// \brief Template copy constructor 275 256 /// … … 279 260 SimplePath(const CPath& cpath) { 280 261 pathCopy(cpath, *this); 281 }282 283 /// \brief Copy assignment284 ///285 SimplePath& operator=(const SimplePath& cpath) {286 pathCopy(cpath, *this);287 return *this;288 262 } 289 263 … … 458 432 ListPath() : first(0), last(0) {} 459 433 460 /// \brief Copy constructor461 ///462 ListPath(const ListPath& cpath) : first(0), last(0) {463 pathCopy(cpath, *this);464 }465 466 434 /// \brief Template copy constructor 467 435 /// … … 478 446 ~ListPath() { 479 447 clear(); 480 }481 482 /// \brief Copy assignment483 ///484 ListPath& operator=(const ListPath& cpath) {485 pathCopy(cpath, *this);486 return *this;487 448 } 488 449 … … 798 759 StaticPath() : len(0), arcs(0) {} 799 760 800 /// \brief Copy constructor801 ///802 StaticPath(const StaticPath& cpath) : arcs(0) {803 pathCopy(cpath, *this);804 }805 806 761 /// \brief Template copy constructor 807 762 /// … … 817 772 ~StaticPath() { 818 773 if (arcs) delete[] arcs; 819 }820 821 /// \brief Copy assignment822 ///823 StaticPath& operator=(const StaticPath& cpath) {824 pathCopy(cpath, *this);825 return *this;826 774 } 827 775 -
test/path_test.cc
r990 r440 39 39 } 40 40 41 // Check if proper copy consructor is called (use valgrind for testing)42 template<class _Path>43 void checkCopy()44 {45 ListDigraph g;46 ListDigraph::Arc a = g.addArc(g.addNode(), g.addNode());47 48 _Path p,q;49 p.addBack(a);50 q=p;51 _Path r(p);52 StaticPath<ListDigraph> s(r);53 }54 55 41 int main() { 56 42 check_concepts(); 57 58 checkCopy<Path<ListDigraph> >();59 checkCopy<SimplePath<ListDigraph> >();60 checkCopy<ListPath<ListDigraph> >();61 62 ListDigraph g;63 ListDigraph::Arc a = g.addArc(g.addNode(), g.addNode());64 65 Path<ListDigraph> p;66 StaticPath<ListDigraph> q,r;67 p.addBack(a);68 q=p;69 r=q;70 StaticPath<ListDigraph> s(q);71 72 43 return 0; 73 44 }
Note: See TracChangeset
for help on using the changeset viewer.