Lines Matching defs:ptr_
69 explicit scoped_ptr(C* p = NULL) : ptr_(p) { }
72 // We don't need to test ptr_ == NULL because C++ does that for us.
75 delete ptr_;
82 if (p != ptr_) {
84 delete ptr_;
85 ptr_ = p;
92 assert(ptr_ != NULL);
93 return *ptr_;
96 assert(ptr_ != NULL);
97 return ptr_;
99 C* get() const { return ptr_; }
104 bool operator==(C* p) const { return ptr_ == p; }
105 bool operator!=(C* p) const { return ptr_ != p; }
109 C* tmp = ptr_;
110 ptr_ = p2.ptr_;
111 p2.ptr_ = tmp;
120 C* retVal = ptr_;
121 ptr_ = NULL;
126 C* ptr_;
177 // We don't need to test ptr_ == NULL because C++ does that for us.
284 explicit scoped_ptr_malloc(C* p = NULL): ptr_(p) {}
288 free_(ptr_);
295 if (ptr_ != p) {
296 free_(ptr_);
297 ptr_ = p;
305 assert(ptr_ != NULL);
306 return *ptr_;
310 assert(ptr_ != NULL);
311 return ptr_;
315 return ptr_;
324 return ptr_ == p;
328 return ptr_ != p;
333 C* tmp = b.ptr_;
334 b.ptr_ = ptr_;
335 ptr_ = tmp;
344 C* tmp = ptr_;
345 ptr_ = NULL;
350 C* ptr_;