template< class R, class D >
class unique_resource;
unique_resource
is universal RAII wrapper for resource handles that owns and manages a resource through a handle and disposes of that resource when the unique_resource
is destroyed.
The resource is disposed of using the deleter of type D
when either of the following happens:
unique_resource
object is destroyed,unique_resource
object is assigned from another resource via operator= or reset().Let type RS
be R
if R
is an object type, or std::reference_wrapper<std::remove_reference_t<R>> otherwise:
unique_resource
effectively holds a subobject of type RS
which is or wraps the resource handle, a deleter of type D
and a bool flag indicating whether the wrapper is owning the resource.RS
is called stored resource handle, and the stored (if R
is an object type) or wrapped (if R
is a reference type) R
is called underlying resource handle. These two terms are not used by the LFTS.unique_resource
unique_resource
Resource handle types satisfying NullablePointer can also be managed by std::unique_ptr. Unlike unique_ptr
, unique_resource
does not require NullablePointer.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4