|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
out_ptr_t::operator Pointer*out_ptr_t::operator void** | ||||
| Non-member functions | ||||
operator Pointer*()constnoexcept; | (1) | (since C++23) |
operatorvoid**()constnoexcept; | (2) | (since C++23) |
Exposes the address of aPointer orvoid* object to a foreign function which will generally re-initialize it.
Pointer object.Pointer is not same asvoid*, and the program is ill-formed ifPointer is not a pointer type.Pointer object converted tovoid*, and any modification to it affects thePointer value used in thedestructor. Accessing thevoid* object outside the lifetime of*this has undefined behavior.Once one of these two conversion functions has been called on anout_ptr_t object, the other shall not be called on it, otherwise, the behavior is undefined.
Contents |
(none)
Pointer object.If the object pointed by the return value has not been rewritten, it is equal tonullptr.
On common implementations, the object representation of everyPointer that is a pointer type is compatible with that ofvoid*, and therefore these implementations typically store thevoid* object within the storage for thePointer object, no additional storage needed:
Pointer member subobject may be used for both conversion functions, and(2) may directly returns its addressreinterpret_cast tovoid**.IfPointer is a pointer type whose object representation is incompatible with that ofvoid*, an additionalbool flag may be needed for recording whether(1) (or(2)) has been called.
| This section is incomplete Reason: no example |