From 43f8dd28407afa029e88c7431c85f193d5ad537d Mon Sep 17 00:00:00 2001 From: "deanm@google.com" Date: Thu, 21 Aug 2008 11:13:46 +0000 Subject: Remove the unused make_scoped_ptr interface. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1150 0039d316-1c4b-4281-b951-d872f2087c98 --- base/scoped_ptr.h | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'base/scoped_ptr.h') diff --git a/base/scoped_ptr.h b/base/scoped_ptr.h index 0c9ea95..a420e77 100644 --- a/base/scoped_ptr.h +++ b/base/scoped_ptr.h @@ -31,25 +31,14 @@ #ifndef BASE_SCOPED_PTR_H__ #define BASE_SCOPED_PTR_H__ -// This is an implementation designed to match the anticipated future TR2 -// implementation of the scoped_ptr class, and its closely-related brethren, -// scoped_array, scoped_ptr_malloc, and make_scoped_ptr. -// -// See http://wiki/Main/ScopedPointerInterface for the spec that drove this -// file. +// This is an implementation designed to match the anticipated future TR2 +// implementation of the scoped_ptr class, and its closely-related brethren, +// scoped_array, scoped_ptr_malloc. #include #include #include - -template class scoped_ptr; -template class scoped_ptr_malloc; -template class scoped_array; - -template -scoped_ptr make_scoped_ptr(C *); - // A scoped_ptr is like a T*, except that the destructor of scoped_ptr // automatically deletes the pointer it holds (if any). // That is, scoped_ptr owns the T object that it points to. @@ -128,8 +117,6 @@ class scoped_ptr { private: C* ptr_; - friend scoped_ptr make_scoped_ptr(C *p); - // Forbid comparison of scoped_ptr types. If C2 != C, it totally doesn't // make sense, and if C2 == C, it still doesn't make sense because you should // never have the same object owned by two different scoped_ptrs. @@ -157,20 +144,6 @@ bool operator!=(C* p1, const scoped_ptr& p2) { return p1 != p2.get(); } -template -scoped_ptr make_scoped_ptr(C *p) { - // This does nothing but to return a scoped_ptr of the type that the passed - // pointer is of. (This eliminates the need to specify the name of T when - // making a scoped_ptr that is used anonymously/temporarily.) From an - // access control point of view, we construct an unnamed scoped_ptr here - // which we return and thus copy-construct. Hence, we need to have access - // to scoped_ptr::scoped_ptr(scoped_ptr const &). However, it is guaranteed - // that we never actually call the copy constructor, which is a good thing - // as we would call the temporary's object destructor (and thus delete p) - // if we actually did copy some object, here. - return scoped_ptr(p); -} - // scoped_array is like scoped_ptr, except that the caller must allocate // with new [] and the destructor deletes objects with delete []. // -- cgit v1.1