26#include <boost/intrusive/list.hpp>
27#include <seastar/util/modules.hh>
52 using hook_type = boost::intrusive::list_member_hook<boost::intrusive::link_mode<boost::intrusive::auto_unlink>>;
56 void clear()
noexcept {
61 _hook.swap_nodes(o._hook);
62 std::swap(_ptr, o._ptr);
67 requires std::convertible_to<U*, T*>
71 _ptr = std::exchange(o._ptr,
nullptr);
72 _hook.swap_nodes(o._hook);
88 swap(o._ptr->weak_from_this());
102 swap(o._ptr->weak_from_this());
107 explicit operator bool()
const noexcept {
return _ptr !=
nullptr; }
108 T* operator->()
const noexcept {
return _ptr; }
109 T& operator*()
const noexcept {
return *_ptr; }
110 T* get()
const noexcept {
return _ptr; }
111 bool operator==(
const weak_ptr& o)
const noexcept {
return _ptr == o._ptr; }
112 bool operator!=(
const weak_ptr& o)
const noexcept {
return _ptr != o._ptr; }
134 boost::intrusive::list<weak_ptr<T>,
135 boost::intrusive::member_hook<weak_ptr<T>,
typename weak_ptr<T>::hook_type, &
weak_ptr<T>::_hook>,
136 boost::intrusive::constant_time_size<false>> _ptr_list;
146 _ptr_list.clear_and_dispose([] (
weak_ptr<T>* wp)
noexcept {
152 _ptr_list.push_back(ptr);
Definition: weak_ptr.hh:46
Definition: weak_ptr.hh:133
Seastar API namespace.
Definition: abort_on_ebadf.hh:26