std::experi...observer_ptr(3)
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_ptrthat has no corresponding watched object. Empty. No thoughts. Head empty. β¨ - 2) Constructs an
observer_ptrthat watchesp. It'sexplicit,constexpr, andnoexceptin the signature β we love a specific queen. π - 3) Constructs an
observer_ptrthat watchesother.get(). This overload participates in overload resolution only ifW2*is convertible toelement_type*β that's the whole vibe check it has to pass, bestie. π«Ά - 4,5) Implicitly declared copy and move constructors. Constructs an
observer_ptrthat watchesother.get(). They're= default, so the compiler is doing the work, main character energy. π
πΈ Parameters πΈ
pβ a pointer to an object to watchotherβ anotherobserver_ptrto 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
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms