|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
out_ptr_t::out_ptr_t | ||||
| Non-member functions | ||||
explicit out_ptr_t( Smart&sp, Args...args); | (1) | (since C++23) |
out_ptr_t(const out_ptr_t&)= delete; | (2) | (since C++23) |
out_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 value-initializes the storedPointer.out_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.
After construction, thePointer orvoid* object pointed by the return value of either conversion function is equal tonullptr.
Every argument inargs... is moved into the createdout_ptr_t if it is of an object type, or transferred into the createdout_ptr_t as-is if it is of a reference type.
The constructor ofout_ptr_t is allowed to throw exceptions. For example, whensp is astd::shared_ptr, the allocation for the new control block may be performed within the constructor rather than the destructor.
| This section is incomplete Reason: no example |