COIN-OR::LEMON - Graph Library

Changes in / [958:a5810903ed28:956:4764031c082c] in lemon-1.2


Ignore:
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/path.h

    r958 r877  
    6565    Path() {}
    6666
    67     /// \brief Copy constructor
    68     ///
    69     Path(const Path& cpath) {
    70       pathCopy(cpath, *this);
    71     }
    72 
    7367    /// \brief Template copy constructor
    7468    ///
     
    7872    Path(const CPath& cpath) {
    7973      pathCopy(cpath, *this);
    80     }
    81 
    82     /// \brief Copy assignment
    83     ///
    84     Path& operator=(const Path& cpath) {
    85       pathCopy(cpath, *this);
    86       return *this;
    8774    }
    8875
     
    266253    SimplePath() {}
    267254
    268     /// \brief Copy constructor
    269     ///
    270     SimplePath(const SimplePath& cpath) {
    271       pathCopy(cpath, *this);
    272     }
    273 
    274255    /// \brief Template copy constructor
    275256    ///
     
    279260    SimplePath(const CPath& cpath) {
    280261      pathCopy(cpath, *this);
    281     }
    282 
    283     /// \brief Copy assignment
    284     ///
    285     SimplePath& operator=(const SimplePath& cpath) {
    286       pathCopy(cpath, *this);
    287       return *this;
    288262    }
    289263
     
    458432    ListPath() : first(0), last(0) {}
    459433
    460     /// \brief Copy constructor
    461     ///
    462     ListPath(const ListPath& cpath) : first(0), last(0) {
    463       pathCopy(cpath, *this);
    464     }
    465 
    466434    /// \brief Template copy constructor
    467435    ///
     
    478446    ~ListPath() {
    479447      clear();
    480     }
    481 
    482     /// \brief Copy assignment
    483     ///
    484     ListPath& operator=(const ListPath& cpath) {
    485       pathCopy(cpath, *this);
    486       return *this;
    487448    }
    488449
     
    798759    StaticPath() : len(0), arcs(0) {}
    799760
    800     /// \brief Copy constructor
    801     ///
    802     StaticPath(const StaticPath& cpath) : arcs(0) {
    803       pathCopy(cpath, *this);
    804     }
    805 
    806761    /// \brief Template copy constructor
    807762    ///
     
    817772    ~StaticPath() {
    818773      if (arcs) delete[] arcs;
    819     }
    820 
    821     /// \brief Copy assignment
    822     ///
    823     StaticPath& operator=(const StaticPath& cpath) {
    824       pathCopy(cpath, *this);
    825       return *this;
    826774    }
    827775
  • test/path_test.cc

    r957 r440  
    3939}
    4040
    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  
    5541int main() {
    5642  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 
    7243  return 0;
    7344}
Note: See TracChangeset for help on using the changeset viewer.