explicit inoout_ptr_t( Smart &sp, Args... args );
inout_ptr_t( const inout_ptr_t& ) = delete;
spas if binds it to the
Smart&member, captures every argument
args...as if initializes the corresponding member of type
std::forward<T>(t), then initializes the stored
Smartis a pointer type, otherwise, initializes it with
sp.release()may be called if
Smartis not a pointer type, in which case it will not be called again within the destructor.
inout_ptr_tis neither copyable nor movable.
|sp||-||the object (typically a smart pointer) to adapt|
|args...||-||the arguments used for resetting to capture|
May throw implementation-defined exceptions.
Smart is not a pointer type and
sp.release() is not called by the constructor, it may be called by the destructor before resetting
Every argument in
args... is moved into the created
inout_ptr_t if it is of an object type, or transferred into the created
inout_ptr_t as-is if it is of a reference type.
The constructor of
inout_ptr_t is allowed to throw exceptions. For example, when
sp 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.
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.