35 #ifndef PALLAS_SCOPED_PTR_H 36 #define PALLAS_SCOPED_PTR_H 79 enum { type_must_be_complete =
sizeof(C) };
90 enum { type_must_be_complete =
sizeof(C) };
102 assert(ptr_ != NULL);
111 assert(ptr_ != NULL);
118 C*
get()
const {
return ptr_; }
180 return p1 == p2.
get();
185 return p1 == p2.
get();
190 return p1 != p2.
get();
195 return p1 != p2.
get();
244 enum { type_must_be_complete =
sizeof(C) };
255 enum { type_must_be_complete =
sizeof(C) };
267 assert(array_ != NULL);
333 return p1 == p2.
get();
338 return p1 == p2.
get();
343 return p1 != p2.
get();
348 return p1 != p2.
get();
357 inline void operator()(
void* x)
const {
364 #endif // PALLAS_SCOPED_PTR_H C element_type
Definition: scoped_ptr.h:228
void swap(scoped_ptr &p2)
Definition: scoped_ptr.h:133
void reset(C *p=NULL)
Deletes the current owned object, if any.
Definition: scoped_ptr.h:88
Definition: scoped_ptr.h:47
C * get() const
Accessor to get the owned object.
Definition: scoped_ptr.h:118
bool operator==(const C *p) const
Definition: scoped_ptr.h:123
C element_type
Definition: scoped_ptr.h:63
Definition: scoped_ptr.h:46
void reset(C *p=NULL)
Deletes the current owned object, if any.
Definition: scoped_ptr.h:253
Definition: basinhopping.h:51
bool operator!=(const C *p) const
Definition: scoped_ptr.h:289
C * operator->() const
Accessor to get the owned object.
Definition: scoped_ptr.h:110
scoped_array(C *p=NULL)
Constructor.
Definition: scoped_ptr.h:236
This class wraps the c library function free() in a class that can be passed as a template argument t...
Definition: scoped_ptr.h:355
~scoped_ptr()
Destructor.
Definition: scoped_ptr.h:78
bool operator!=(const C *p) const
Definition: scoped_ptr.h:128
Definition: scoped_ptr.h:45
void swap(scoped_array &p2)
Definition: scoped_ptr.h:294
C * release()
Release a pointer.
Definition: scoped_ptr.h:146
C & operator*() const
Accessor to get the owned object.
Definition: scoped_ptr.h:101
C * release()
Release an array.].
Definition: scoped_ptr.h:307
C * get() const
Get a pointer to the zeroth element of the current object.
Definition: scoped_ptr.h:275
C & operator[](std::ptrdiff_t i) const
Get one element of the current object.
Definition: scoped_ptr.h:265
friend scoped_ptr< C > make_scoped_ptr(C *p)
Definition: scoped_ptr.h:210
~scoped_array()
Destructor.
Definition: scoped_ptr.h:243
scoped_ptr(C *p=NULL)
Constructor. Defaults to intializing with NULL. There is no way to create an uninitialized scoped_ptr...
Definition: scoped_ptr.h:71
bool operator==(const C *p) const
Definition: scoped_ptr.h:283