LLVM API Documentation
An owning, copyable polymorphic smart pointer. More...
#include <polymorphic_ptr.h>
Public Member Functions | |
polymorphic_ptr (T *ptr=0) | |
polymorphic_ptr (const polymorphic_ptr &arg) | |
~polymorphic_ptr () | |
polymorphic_ptr & | operator= (polymorphic_ptr arg) |
polymorphic_ptr & | operator= (T *arg) |
T & | operator* () const |
T * | operator-> () const |
LLVM_EXPLICIT | operator bool () const |
bool | operator! () const |
T * | get () const |
T * | take () |
void | swap (polymorphic_ptr &arg) |
An owning, copyable polymorphic smart pointer.
This pointer exists to provide copyable owned smart pointer. Rather than shared ownership semantics, it has unique ownership semantics and deep copy semantics. It is copyable by requiring that the underlying type exposes a method which can produce a (heap allocated) clone.
Note that in almost all scenarios use of this could be avoided if we could build move-only containers of a std::unique_ptr, but until then this provides an effective way to place polymorphic objects in a container.
Definition at line 37 of file polymorphic_ptr.h.
|
inline |
Definition at line 41 of file polymorphic_ptr.h.
|
inline |
Definition at line 42 of file polymorphic_ptr.h.
|
inline |
Definition at line 46 of file polymorphic_ptr.h.
|
inline |
Definition at line 65 of file polymorphic_ptr.h.
Referenced by llvm::operator!=(), and llvm::operator==().
|
inline |
Definition at line 62 of file polymorphic_ptr.h.
|
inline |
Definition at line 63 of file polymorphic_ptr.h.
|
inline |
Definition at line 60 of file polymorphic_ptr.h.
|
inline |
Definition at line 61 of file polymorphic_ptr.h.
|
inline |
Definition at line 48 of file polymorphic_ptr.h.
References llvm::polymorphic_ptr< T >::swap().
|
inline |
Definition at line 52 of file polymorphic_ptr.h.
|
inline |
Definition at line 73 of file polymorphic_ptr.h.
Referenced by llvm::polymorphic_ptr< T >::operator=(), and llvm::swap().
|
inline |
Definition at line 67 of file polymorphic_ptr.h.