std::experi...observer_ptr(3)

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

okay so bestie, welcome to std::experi...observer_ptr(3) ✨ β€” yes, the header is literally truncated with ..., we love a mysterious queen. This page lives in the C++ Standard Libary (their spelling, not mine 😭), and it's all about the constructor of std::experimental::observer_ptr.

πŸŽ€ NAME πŸŽ€

std::experimental::observer_ptr::observer_ptr - std::experimental::observer_ptr::observer_ptr

It's giving constructor energy, no cap. The NAME line really says it twice, and honestly? Iconic. πŸ’…

✨ Synopsis ✨

Here's the synopsis, copied exactly because signatures are sacred, bestie:

          constexpr observer_ptr() noexcept;                  (1) (library
       fundamentals TS v2)
          constexpr observer_ptr( nullptr_t ) noexcept;
          constexpr explicit observer_ptr( element_type* p )  (2) (library
       fundamentals TS v2)
          noexcept;
          template< class W2 >
          constexpr observer_ptr( observer_ptr<W2> other )    (3) (library
       fundamentals TS v2)
          noexcept;
          observer_ptr( const observer_ptr& other ) =         (4) (library
       fundamentals TS v2)
          default;                                                (implicitly
       declared)
          observer_ptr( observer_ptr&& other ) = default;     (5) (library
       fundamentals TS v2)
                                                                  (implicitly
       declared)

All five overloads are tagged (library fundamentals TS v2), and (4) + (5) are (implicitly declared). Slay.

πŸ’– what each overload is giving πŸ’–

  • 1) Constructs an observer_ptr that has no corresponding watched object. Empty. No thoughts. Head empty. ✨
  • 2) Constructs an observer_ptr that watches p. It's explicit, constexpr, and noexcept in the signature β€” we love a specific queen. πŸ’…
  • 3) Constructs an observer_ptr that watches other.get(). This overload participates in overload resolution only if W2* is convertible to element_type* β€” that's the whole vibe check it has to pass, bestie. 🫢
  • 4,5) Implicitly declared copy and move constructors. Constructs an observer_ptr that watches other.get(). They're = default, so the compiler is doing the work, main character energy. πŸ‘‘

🌸 Parameters 🌸

  • p β€” a pointer to an object to watch
  • other β€” another observer_ptr to copy from

that's the whole page, bestie 🫢 β€” source/version is http://cppreference.com, dated 2024.06.10, and the page is std::experi...observer_ptr(3). mwah πŸ’‹

πŸ“¦ where this page comes from