std::out_ptr_t::out_ptr_t(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ NAME ✨

std::out_ptr_t::out_ptr_t - std::out_ptr_t::out_ptr_t

okay bestie, this is the std::out_ptr_t::out_ptr_t(3) page from the C++ Standard Libary manual β€” yes, that spelling is what the header says, iykyk πŸ˜­πŸ’…


πŸ¦‹ Synopsis πŸ¦‹

explicit out_ptr_t( Smart &sp, Args... args ); (1) (since C++23)
out_ptr_t( const out_ptr_t& ) = delete;        (2) (since C++23)
  1. Creates an out_ptr_t. Adapts sp as if it 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 value-initializes the stored Pointer. Then calls sp.reset() if the expression is well-formed; otherwise, calls sp = Smart() if std::is_default_constructible_v<Smart> is true. The program is ill-formed if both resetting operations are ill-formed. 🫢
  2. Copy constructor is explicitly deleted. out_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) β€” literally no return value, bestie 😌

πŸ’œ Exceptions πŸ’œ

May throw implementation-defined exceptions.

🧚 Notes 🧚

  • After construction, the Pointer or void* object pointed by the return value of either conversion function is equal to nullptr. ✨
  • Every argument in args... is moved into the created out_ptr_t if it is of an object type, or transferred into the created out_ptr_t as-is if it is of a reference type.
  • The constructor of out_ptr_t is allowed to throw exceptions. For example, when sp is a std::shared_ptr, the allocation for the new control block may be performed within the constructor rather than the destructor.

😭 Example 😭

This section is incomplete.

Reason: no example.

πŸŽ€ Category: πŸŽ€

  • Todo no example

mwah πŸ’‹ cute sign-off time: source http://cppreference.com, version/date 2024.06.10, page std::out_ptr_t::out_ptr_t(3) β€” catch u later, bestie 🫢

πŸ“¦ where this page comes from