std::out_ptr_t<Smart,Pointer,Args...>::~out_ptr_t
From cppreference.com
C++
Memory management library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::out_ptr_t
| Member functions | ||||
out_ptr_t::~out_ptr_t | ||||
| Non-member functions | ||||
~out_ptr_t(); |
(since C++23) | |
Resets the adapted Smart object by the value of modified Pointer object (or the void* object if operator void**()
Let
sdenotes the adaptedSmartobject,args...denotes the captured arguments,-
pdenotes the value of storedPointer, or static_cast <Pointer> ( *operator void ** ( ) ) if operator void** -
SPbe- Smart::pointer, if it is valid and denotes a type, otherwise,
- Smart::element_type*, if Smart::element_type
- std::pointer_traits <Smart> :: element_type * , if std::pointer_traits <Smart> :: element_type
Pointer.
If s.reset ( static_cast <SP> (p), std::forward <Args> (args)...)
- if (p) s.reset ( static_cast <SP> (p), std::forward <Args> (args)...) ;
otherwise, if std::is_constructible_v<Smart, SP, Args...> is true
- if (p) s = Smart( static_cast <SP> (p), std::forward <Args> (args)...) ;
otherwise, the program is ill-formed.
Notes
If Smart is a
std::shared_ptr
Arguments captured by value are destroyed after resetting.