Skip to content

Commit

Permalink
Update blobptr.h
Browse files Browse the repository at this point in the history
  • Loading branch information
qwert2603 authored and pezy committed Mar 20, 2015
1 parent ae2d2f0 commit c2c0cc3
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 c2c0cc3

Please sign in to comment.