|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
inout_ptr_t::inout_ptr_t | ||||
| Non-member functions | ||||
explicit inout_ptr_t( Smart&sp, Args...args); | (1) | (since C++23) |
inout_ptr_t(const inout_ptr_t&)= delete; | (2) | (since C++23) |
inout_ptr_t. Adaptssp as if binds it to theSmart& member, captures every argumentt inargs... as if initializes the corresponding member of typeT inArgs... withstd::forward<T>(t), then initializes the storedPointer withsp ifSmart is a pointer type, otherwise, initializes it withsp.get().sp.release() may be called ifSmart is not a pointer type, in which case it will not be called again within the destructor.inout_ptr_t is neither copyable nor movable.Contents |
| sp | - | the object (typically a smart pointer) to adapt |
| args... | - | the arguments used for resetting to capture |
(none)
May throw implementation-defined exceptions.
IfSmart is not a pointer type andsp.release() is not called by the constructor, it may be called by the destructor before resettingsp.
Every argument inargs... is moved into the createdinout_ptr_t if it is of an object type, or transferred into the createdinout_ptr_t as-is if it is of a reference type.
The constructor ofinout_ptr_t is allowed to throw exceptions. For example, whensp is an intrusive pointer with a control block, the allocation for the new control block may be performed within the constructor rather than the destructor.
| This section is incomplete Reason: no example |