std::experimental::observer_ptr<W>::observer_ptr
From cppreference.com
< cpp | experimental | observer ptr
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Experimental
Filesystem library (filesystem TS)
Library fundamentals (library fundamentals TS)
Library fundamentals 2 (library fundamentals TS v2)
Library fundamentals 3 (library fundamentals TS v3)
Extensions for parallelism (parallelism TS)
Extensions for parallelism 2 (parallelism TS v2)
Extensions for concurrency (concurrency TS)
Extensions for concurrency 2 (concurrency TS v2)
Concepts (concepts TS)
Ranges (ranges TS)
Reflection (reflection TS)
Mathematical special functions (special functions TR)
std::experimental::observer_ptr
Member functions
observer_ptr::observer_ptr
Modifiers
Observers
Conversions
Non-member functions
constexpr observer_ptr() noexcept;
constexpr observer_ptr( nullptr_t ) noexcept;
(1)
(library fundamentals TS v2)
constexpr observer_ptr( nullptr_t ) noexcept;
constexpr explicit observer_ptr( element_type* p ) noexcept;
(2)
(library fundamentals TS v2)
template< class W2 >
constexpr observer_ptr( observer_ptr<W2> other ) noexcept;
(3)
(library fundamentals TS v2)
constexpr observer_ptr( observer_ptr<W2> other ) noexcept;
observer_ptr( const observer_ptr& other ) = default;
(4)
(library fundamentals TS v2) (implicitly declared)
observer_ptr( observer_ptr&& other ) = default;
(5)
(library fundamentals TS v2) (implicitly declared)
1) Constructs an
observer_ptr
that has no corresponding watched object.2) Constructs an
observer_ptr
that watches p.3) Constructs an
observer_ptr
that watches other.get(). This overload participates in overload resolution only if W2* is convertible to element_type*.4,5) Implicitly declared copy and move constructors. Constructs an
observer_ptr
that watches other.get().[edit] Parameters
p
-
a pointer to an object to watch
other
-
another
observer_ptr
to copy from