| Index: src/smart-pointer.h
|
| diff --git a/src/smart-pointer.h b/src/smart-pointer.h
|
| index 03fd229b43c50262f72d8656f50fbcc0b7312bd3..c39df16869582f9426cec5a4162046d57675b180 100644
|
| --- a/src/smart-pointer.h
|
| +++ b/src/smart-pointer.h
|
| @@ -86,7 +86,7 @@ class SmartPointer {
|
| // the copy constructor it removes the pointer in the original to avoid
|
| // double freeing.
|
| inline SmartPointer& operator=(const SmartPointer<T>& rhs) {
|
| - ASSERT(p == NULL);
|
| + ASSERT(is_empty());
|
| T* tmp = rhs.p; // swap to handle self-assignment
|
| const_cast<SmartPointer<T>&>(rhs).p = NULL;
|
| p = tmp;
|
| @@ -94,6 +94,11 @@ class SmartPointer {
|
| }
|
|
|
|
|
| + inline bool is_empty() {
|
| + return p == NULL;
|
| + }
|
| +
|
| +
|
| private:
|
| T* p;
|
| };
|
|
|