Home | History | Annotate | Download | only in common

Lines Matching defs:scoped_ptr

34 // Example usage (scoped_ptr):
36 // scoped_ptr<Foo> foo(new Foo("wee"));
40 // scoped_ptr<Foo> foo; // No pointer managed.
64 // implementation of the scoped_ptr class, and its closely-related brethren,
73 // A scoped_ptr<T> is like a T*, except that the destructor of scoped_ptr<T>
75 // That is, scoped_ptr<T> owns the T object that it points to.
76 // Like a T*, a scoped_ptr<T> may hold either NULL or a pointer to a T object.
77 // Also like T*, scoped_ptr<T> is thread-compatible, and once you
80 // The size of a scoped_ptr is small:
81 // sizeof(scoped_ptr<C>) == sizeof(C*)
83 class scoped_ptr {
90 // There is no way to create an uninitialized scoped_ptr.
92 explicit scoped_ptr(C* p = NULL) : ptr_(p) { }
96 ~scoped_ptr() {
125 // These return whether two scoped_ptr refer to the same object, not just to
131 void swap(scoped_ptr& p2) {
151 // Forbid comparison of scoped_ptr types. If C2 != C, it totally doesn't
154 template <class C2> bool operator==(scoped_ptr<C2> const& p2) const;
155 template <class C2> bool operator!=(scoped_ptr<C2> const& p2) const;
158 scoped_ptr(const scoped_ptr&);
159 void operator=(const scoped_ptr&);
164 void swap(scoped_ptr<C>& p1, scoped_ptr<C>& p2) {
169 bool operator==(C* p1, const scoped_ptr<C>& p2) {
174 bool operator!=(C* p1, const scoped_ptr<C>& p2) {
178 // scoped_array<C> is like scoped_ptr<C>, except that the caller must allocate
181 // As with scoped_ptr<C>, a scoped_array<C> either points to an object
292 // scoped_ptr_malloc<> is similar to scoped_ptr<>, but it accepts a
303 // There is no way to create an uninitialized scoped_ptr.