A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../experimental/scope_success/../unique_resource.html below:

std::experimental::unique_resource - cppreference.com

std::experimental::unique_resource

template< class R, class D >
class unique_resource;

(library fundamentals TS v3)

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:

Let type RS be R if R is an object type, or std::reference_wrapper<std::remove_reference_t<R>> otherwise:

[edit] Template parameters [edit] Member functions constructs a new unique_resource
(public member function) [edit] disposes the managed resource if such is present
(public member function) [edit] assigns a unique_resource
(public member function) [edit] Modifiers releases the ownership
(public member function) [edit] disposes or replaces the managed resource
(public member function) [edit] Observers accesses the underlying resource handle
(public member function) [edit] accesses the deleter used for disposing of the managed resource
(public member function) [edit] accesses the pointee if the resource handle is a pointer
(public member function) [edit] [edit] Non-member functions [edit] Deduction guides [edit] Notes

Resource handle types satisfying NullablePointer can also be managed by std::unique_ptr. Unlike unique_ptr, unique_resource does not require NullablePointer.

[edit] Example [edit] See also smart pointer with unique object ownership semantics
(class template) [edit]

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