std::experi...ource::reset(3)
πΈ NAME πΈ
std::experimental::unique_resource::reset β std::experimental::unique_resource::reset. yes, it's literally the same name twice, and honestly? iconic. π
This is the page from the C++ Standard Libary manual β that spelling is the header's, not mine, bestie π β and it's all about the reset member of std::experimental::unique_resource. π¦
β¨ Synopsis β¨
here's the exact synopsis, untouched because code is sacred:
void reset() noexcept; (1) (library fundamentals TS v3)
template< class RR > (2) (library fundamentals TS v3)
void reset( RR&& r );
- Overload
(1)β Disposes the resource by calling the deleter with the underlying resource handle if theunique_resourceowns it. Theunique_resourcedoes not own the resource after the call. periodt. π - Overload
(2)β Replaces the resource by calling(1)and then assigns the stored resource handle withstd::forward<RR>(r)ifstd::is_nothrow_assignable_v<RS, RR>istrue, otherwisestd::as_const(r), whereRSis the type of stored resource handle. Theunique_resourceowns the resource after the call. π«Ά
If copy-assignment of the stored resource handle throws an exception, it calls del_(r), where del is the deleter object.
This overload participates in overload resolution only if the selected assignment expression assigning the stored resource handle is well-formed.
The program is ill-formed if del_(r) is ill-formed.
The behavior is undefined if del_(r) results in undefined behavior or throws an exception. so yeah, that's a big ol' "do not pass go" situation ππ
π Parameters π
rβ resource handle for a new resource to manage. π«Ά
π Return value π
(none)β literally no return value, bestie. π
π«Ά Exceptions π«Ά
2)Any exception thrown in assigning the stored resource handle. π
π§ Notes π§
The mechanism ensures no leaking of resources. slay, no leaks. β¨
π Example π
This section is incomplete.
Reason: no example.
(not me leaving the example section empty β iconic but incomplete π)
π See also π
resetreplaces the managed object β (public member function ofstd::unique_ptr<T,Deleter>). π
π Category π
- Todo no example π
that's the whole page, bestie! π source/version: http://cppreference.com, date 2024.06.10 β go off, C++ docs πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms