std::experi...tr::weak_ptr(3)

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

🌸 NAME 🌸

okay bestie, welcome to std::experi...tr::weak_ptr(3) from the C++ Standard Libary manual β€” yes, β€œLibary” is literally what the header says, and we respect the typo πŸ’….

The NAME section is giving repetition main character energy: std::experimental::weak_ptr::weak_ptr β€” and then again, std::experimental::weak_ptr::weak_ptr. It’s the std::experimental::weak_ptr::weak_ptr constructor, periodt.


πŸŽ€ Synopsis πŸŽ€

Constructs a new weak_ptr that potentially shares an object with r.

  • (1) (library fundamentals TS)
constexpr weak_ptr() noexcept;
  • (2) (library fundamentals TS)
weak_ptr( const weak_ptr& r ) noexcept;
  • (2) (library fundamentals TS)
template< class Y >
weak_ptr( const weak_ptr<Y>& r ) noexcept;
  • (2) (library fundamentals TS)
template< class Y >
weak_ptr( const std::experimental::shared_ptr<Y>& r ) noexcept;
  • (3) (library fundamentals TS)
weak_ptr( weak_ptr&& r ) noexcept;
  • (3) (library fundamentals TS)
template< class Y >
weak_ptr( weak_ptr<Y>&& r ) noexcept;
  1. Default constructor. Constructs empty weak_ptr. Lowkey the simplest slay.
  2. Constructs new weak_ptr which shares an object managed by r. If r manages no object, *this manages no object too. The templated overloads don't participate in overload resolution unless either Y* is implicitly convertible to T*, or Y is the type "array of N U" for some type U and some number N, and T is the type "array of unknown bound of (possibly cv-qualified) U". Yes bestie, that’s the whole vibe check 🫢.
  3. Move constructors. Moves a weak_ptr instance from r into *this. After this, r is empty and r.use_count() == 0. The templated overload doesn't participate in overload resolution unless either Y* is implicitly convertible to T*, or Y is the type "array of N U" for some type U and some number N, and T is the type "array of unknown bound of (possibly cv-qualified) U". Same energy, singular overload edition ✨.

🫢 Parameters 🫢

  • r β€” a std::experimental::shared_ptr or std::experimental::weak_ptr that will be viewed by this std::experimental::weak_ptr.

πŸ’€ Exceptions πŸ’€

noexcept specification: noexcept


πŸ“ Example πŸ“

This section is incomplete Reason: no example

🌈 See also 🌈

  • constructor β€” creates a new weak_ptr (public member function of std::weak_ptr<T>)
  • operator= β€” assigns the weak_ptr (public member function of std::weak_ptr<T>)

🧚 Categories 🧚

  • Noindexed pages
  • unconditionally noexcept
  • Todo no example

that’s the whole page, bestie πŸ’– source: http://cppreference.com, version/date: 2024.06.10, page: std::experi...tr::weak_ptr(3) β€” bye byeee πŸŽ€

πŸ“¦ where this page comes from