Skip to content

Commit

Permalink
Merge pull request Mooophy#157 from qwert2603/patch-3
Browse files Browse the repository at this point in the history
Update blobptr.h
  • Loading branch information
Mooophy committed Mar 20, 2015
2 parents 97305b1 + 03ac23a commit 7d38d3e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ch16/ex16.12.13/blobptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,18 @@ BlobPtr<T> BlobPtr<T>::operator --(int)
return ret;
}

template<typename T> bool operator==(const StrPtr<T> &lhs, const StrPtr<T> &rhs) {
if (_l.ptr.lock() != _r.ptr.lock()) {
throw runtime_error("ptrs to different Blobs!");
}
return _l.i == _r.i;
}

template<typename T> bool operator< (const BlobPtr<T> &lhs, const BlobPtr<T> &rhs) {
if (_l.ptr.lock() != _r.ptr.lock()) {
throw runtime_error("ptrs to different Blobs!");
}
return _l.i < _r.i;
}

#endif // BLOBPTR_H

0 comments on commit 7d38d3e

Please sign in to comment.