Skip to content

Commit

Permalink
Update ex14_16_StrBlob.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooophy committed Jun 28, 2015
1 parent 6d2f3ca commit d951217
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions ch14/ex14_16_StrBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@

bool operator==(const StrBlob &lhs, const StrBlob &rhs)
{
return *lhs.data == *rhs.data;
return *lhs.data == *rhs.data;
}

bool operator!=(const StrBlob &lhs, const StrBlob &rhs)
{
return !(lhs == rhs);
return !(lhs == rhs);
}

bool operator==(const StrBlobPtr &lhs, const StrBlobPtr &rhs)
{
return lhs.curr == rhs.curr;
return lhs.curr == rhs.curr;
}

bool operator!=(const StrBlobPtr &lhs, const StrBlobPtr &rhs)
{
return !(lhs == rhs);
return !(lhs == rhs);
}

bool operator==(const ConstStrBlobPtr &lhs, const ConstStrBlobPtr &rhs)
{
return lhs.curr == rhs.curr;
return lhs.curr == rhs.curr;
}

bool operator!=(const ConstStrBlobPtr &lhs, const ConstStrBlobPtr &rhs)
{
return !(lhs == rhs);
return !(lhs == rhs);
}

//==================================================================
Expand All @@ -44,18 +44,18 @@ bool operator!=(const ConstStrBlobPtr &lhs, const ConstStrBlobPtr &rhs)

StrBlob& StrBlob::operator=(const StrBlob &lhs)
{
data = make_shared<vector<string>>(*lhs.data);
return *this;
data = make_shared<vector<string>>(*lhs.data);
return *this;
}

StrBlob& StrBlob::operator=(StrBlob &&rhs) NOEXCEPT
{
if (this != &rhs) {
data = std::move(rhs.data);
rhs.data = nullptr;
}
if (this != &rhs) {
data = std::move(rhs.data);
rhs.data = nullptr;
}

return *this;
return *this;
}

//==================================================================
Expand All @@ -66,12 +66,12 @@ StrBlob& StrBlob::operator=(StrBlob &&rhs) NOEXCEPT

StrBlobPtr StrBlob::begin()
{
return StrBlobPtr(*this);
return StrBlobPtr(*this);
}

StrBlobPtr StrBlob::end()
{
return StrBlobPtr(*this, data->size());
return StrBlobPtr(*this, data->size());
}

ConstStrBlobPtr StrBlob::cbegin() const
Expand Down

0 comments on commit d951217

Please sign in to comment.