https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124024
Bug ID: 124024
Summary: Wrong docstring for std::out_ptr
Product: gcc
Version: 15.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: programmer00001h at gmail dot com
Target Milestone: ---
/// Adapt a smart pointer for functions taking an output pointer parameter.
/**
* @tparam _Pointer The type of pointer to convert to.
* @param __s The pointer that should take ownership of the result.
* @param __args... Arguments to use when resetting the smart pointer.
* @return A std::inout_ptr_t referring to `__s`.
* @since C++23
* @headerfile <memory>
*/
template<typename _Pointer = void, typename _Smart, typename... _Args>
inline auto
out_ptr(_Smart& __s, _Args&&... __args)
{
-- excerpt from `bits/out_ptr.h`
The @return line is wrong; it should return (and indeed returns) a
std::out_ptr_t, not std::inout_ptr_t.
This seems like a copy-paste mistake from the inout_ptr docstring.