GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::experimental::observer_ptr(3) C++ Standard Libary std::experimental::observer_ptr(3)

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


Defined in header <experimental/memory>
template< class W > (library fundamentals TS v2)
class observer_ptr;


std::experimental::observer_ptr is a non-owning pointer, or observer. The observer
stores a pointer to a second object, known as the watched object. An observer_ptr
may also have no watched object.


An observer is not responsible in any way for the watched object; there is no
inherent relationship between an observer and the object it watches.


It is intended as a near drop-in replacement for raw pointer types, with the
advantage that, as a vocabulary type, it indicates its intended use without need for
detailed analysis by code readers.


Specializations of observer_ptr satisfy the requirements of CopyConstructible and
CopyAssignable.


-
W shall not be a reference type, but may be an incomplete type.


Member type Definition
element_type W, the type of the object watched by this observer_ptr


constructor constructs a new observer_ptr
(public member function)
destructor destructs an observer_ptr
(implicitly declared) (public member function)
operator= implicitly declared copy and move assignment operators that
(implicitly declared) assign the stored pointer
(public member function)


returns a pointer to the watched object and stops watching
release the object
(public member function)
reset replaces the watched object
(public member function)
swap swaps the watched objects
(public member function)


get returns a pointer to the watched object
(public member function)
operator bool checks if there is an associated watched object
(public member function)
operator* dereferences pointer to the watched object
operator-> (public member function)


operator element_type* explicit conversion function to the stored pointer
(public member function)


creates a observer_ptr that
make_observer watches an object
(function template)
operator==
operator!= compares to another
operator< observer_ptr or with
operator<= nullptr
operator> (function template)
operator>=
specializes the swap
std::experimental::swap(std::experimental::observer_ptr) algorithm
(function template)


std::hash<std::experimental::observer_ptr> hash support for observer_ptr
(class template specialization)


This section is incomplete
Reason: no example

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.