1#ifndef OBSERVER_PTR_HPP
2#define OBSERVER_PTR_HPP
33 template <
typename _Up,
34 typename =
typename std::enable_if<
36 typename std::add_pointer<_Up>::type,
__pointer>::
63 constexpr explicit operator bool() const noexcept
65 return get() !=
nullptr;
69 constexpr explicit operator __pointer() const noexcept
92 std::swap(
__t, __p.__t);
112template <
typename T,
typename _Up>
115 return __p1.
get() == __p2.
get();
118template <
typename T,
typename _Up>
121 return !(__p1 == __p2);
148template <
typename T,
typename _Up>
152 typename std::common_type<
153 typename std::add_pointer<T>::type,
154 typename std::add_pointer<_Up>::type>::type>{}(__p1.
get(),
158template <
typename T,
typename _Up>
164template <
typename T,
typename _Up>
167 return !(__p2 < __p1);
170template <
typename T,
typename _Up>
173 return !(__p1 < __p2);
Definition observer_ptr.hpp:7
std::add_pointer_t< T > __pointer
Definition observer_ptr.hpp:11
constexpr observer_ptr() noexcept
Definition observer_ptr.hpp:16
constexpr __pointer operator->() const noexcept
Definition observer_ptr.hpp:58
T element_type
Definition observer_ptr.hpp:10
std::add_lvalue_reference_t< T > __reference
Definition observer_ptr.hpp:12
constexpr __pointer release() noexcept
Definition observer_ptr.hpp:76
constexpr void swap(observer_ptr &__p) noexcept
Definition observer_ptr.hpp:90
constexpr __reference operator*() const
Definition observer_ptr.hpp:52
constexpr observer_ptr(observer_ptr< _Up > __p) noexcept
Definition observer_ptr.hpp:39
constexpr observer_ptr(__pointer __p) noexcept
Definition observer_ptr.hpp:27
constexpr void reset(__pointer __p=nullptr) noexcept
Definition observer_ptr.hpp:84
constexpr __pointer get() const noexcept
Definition observer_ptr.hpp:46
constexpr observer_ptr(std::nullptr_t) noexcept
Definition observer_ptr.hpp:22
__pointer __t
Definition observer_ptr.hpp:96
void swap(observer_ptr< T > &__p1, observer_ptr< T > &__p2) noexcept
Definition observer_ptr.hpp:100
observer_ptr< T > make_observer(T *__p) noexcept
Definition observer_ptr.hpp:107
bool operator!=(observer_ptr< T > __p1, observer_ptr< _Up > __p2)
Definition observer_ptr.hpp:119
bool operator>(observer_ptr< T > __p1, observer_ptr< _Up > __p2)
Definition observer_ptr.hpp:159
bool operator<(observer_ptr< T > __p1, observer_ptr< _Up > __p2)
Definition observer_ptr.hpp:149
bool operator==(observer_ptr< T > __p1, observer_ptr< _Up > __p2)
Definition observer_ptr.hpp:113
bool operator>=(observer_ptr< T > __p1, observer_ptr< _Up > __p2)
Definition observer_ptr.hpp:171
bool operator<=(observer_ptr< T > __p1, observer_ptr< _Up > __p2)
Definition observer_ptr.hpp:165