A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../algorithm/../../cpp/memory/inout_ptr_t/inout_ptr.html below:

std::inout_ptr - cppreference.com

template< class Pointer = void, class Smart, class... Args >
auto inout_ptr( Smart& s, Args&&... args );

(since C++23)

Returns an inout_ptr_t with deduced template arguments that captures arguments for resetting by reference.

The program is ill-formed if construction of the return value (see below) is ill-formed.

[edit] Parameters s - the object (typically a smart pointer) to adapt args... - the arguments for resetting to capture [edit] Return value

std::inout_ptr_t<Smart, P, Args&&>(s, std::forward<Args>(args)...), where P is

[edit] Notes

Users may specify the template argument for the template parameter Pointer, in order to interoperate with foreign functions that take a Pointer*.

As all arguments for resetting are captured by reference, the returned inout_ptr_t should be a temporary object destroyed at the end of the full-expression containing the call to the foreign function, in order to avoid dangling references.

[edit] Example [edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4