std::inout_ptr_t<Smart,Pointer,Args...>::inout_ptr_t
From cppreference.com
< cpp | memory | inout ptr t
C++
Memory management library
|
|
|
std::inout_ptr_t
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) |
1) Creates an
inout_ptr_t
. Adapts sp as if binds it to the Smart& member, captures every argument t
in args... as if initializes the corresponding member of type T
in Args...
with
std::forward
<T>
(t)
, then initializes the stored Pointer
with sp if Smart
is a pointer type, otherwise, initializes it with sp.get(). sp.release() may be called if Smart
2) Copy constructor is explicitly deleted.
inout_ptr_t
is neither copyable nor movable.Parameters
sp | - | the object (typically a smart pointer) to adapt |
args... | - | the arguments used for resetting to capture |
Return value
(none)
Exceptions
May throw implementation-defined exceptions.
Notes
If Smart
is not a pointer type and sp.release() is not called by the constructor, it may be called by the destructor before resetting sp
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
The constructor of inout_ptr_t
is allowed to throw exceptions. For example, when sp
Example
This section is incomplete Reason: no example |