~allanlesage/libcolumbus/enable-coverage-option

« back to all changes in this revision

Viewing changes to src/WordList.cc

  • Committer: Jussi Pakkanen
  • Date: 2013-07-02 11:45:51 UTC
  • mto: (451.1.1 libcolumbus)
  • mto: This revision was merged to the branch mainline in revision 452.
  • Revision ID: jussi.pakkanen@canonical.com-20130702114551-z4a3as60m48rxvo9
Made WordList movable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    p->words = wl.p->words;
40
40
}
41
41
 
 
42
WordList::WordList(WordList &&wl) {
 
43
    p = wl.p;
 
44
    wl.p = nullptr;
 
45
}
42
46
 
43
47
WordList::~WordList() {
44
48
    delete p;
64
68
    return *this;
65
69
}
66
70
 
 
71
const WordList& WordList::operator=(WordList &&wl) {
 
72
    if(this != &wl) {
 
73
        delete p;
 
74
        p = wl.p;
 
75
        wl.p = nullptr;
 
76
    }
 
77
    return *this;
 
78
}
 
79
 
67
80
bool WordList::operator==(const WordList &l) const {
68
81
    return p->words == l.p->words;
69
82
}