LLVM
8.0.1
|
Class you can specialize to provide custom retain/release functionality for a type. More...
#include "llvm/ADT/IntrusiveRefCntPtr.h"
Static Public Member Functions | |
static void | retain (T *obj) |
static void | release (T *obj) |
Class you can specialize to provide custom retain/release functionality for a type.
Usually specializing this class is not necessary, as IntrusiveRefCntPtr works with any type which defines Retain() and Release() functions – you can define those functions yourself if RefCountedBase doesn't work for you.
One case when you might want to specialize this type is if you have
Because Foo.h includes Bar.h, Bar.h can't include Foo.h in order to pull in the declaration of Foo. Without the declaration of Foo, normally Bar.h wouldn't be able to use IntrusiveRefCntPtr<Foo>, which wants to call T::Retain and T::Release.
To resolve this, Bar.h could include a third header, FooFwd.h, which forward-declares Foo and specializes IntrusiveRefCntPtrInfo<Foo>. Then Bar.h could use IntrusiveRefCntPtr<Foo>, although it still couldn't call any functions on Foo itself, because Foo would be an incomplete type.
Definition at line 125 of file IntrusiveRefCntPtr.h.
|
inlinestatic |
Definition at line 127 of file IntrusiveRefCntPtr.h.
Referenced by llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem >::resetWithoutRelease().
|
inlinestatic |
Definition at line 126 of file IntrusiveRefCntPtr.h.
Referenced by llvm::IntrusiveRefCntPtr< llvm::vfs::FileSystem >::resetWithoutRelease().