19 template <
template <
typename>
class Atom = std::atomic>
25 counts.fetch_add(
count);
29 return counts.fetch_sub(
count);
34 template <
template <
typename>
class Atom = std::atomic>
46 template <
typename T,
template <
typename>
class Atom = std::atomic>
92 explicit operator bool()
const {
93 return p_ ==
nullptr ?
false :
true;
96 return get() == p.
get();
101 template <
typename>
class Atom = std::atomic,
107 throw std::bad_alloc();
111 new (
ptr)
T(std::forward<Args>(args)...);
115 template <
template <
typename>
class Atom = std::atomic>
118 template <
typename T,
typename...
Args>
120 return make_counted<Atom, T>(std::forward<
Args...>(args...));
122 template <
typename T>
126 template <
typename T>
131 template <
typename T>
136 template <
typename T>
143 template <
typename T>
149 release_shared<T>(base, 1);
158 template <
typename T>
static counted_base * get_counted_base(const counted_ptr< T, Atom > &bar)
void add_ref(uint64_t count=1)
static void release_shared(counted_base *base, uint64_t count)
counted_ptr & operator=(const counted_ptr &o)
internal::ArgsMatcher< InnerMatcher > Args(const InnerMatcher &matcher)
static T * release_ptr(counted_ptr< T, Atom > &p)
static intrusive_shared_count< Atom > * getRef(void *pt)
bool operator==(const counted_ptr< T, Atom > &p) const
counted_ptr< T, Atom > make_counted(Args &&...args)
static T * get_shared_ptr(counted_base *base)
counted_ptr(const counted_ptr &o)
uint64_t release_ref(uint64_t count=1)
std::add_lvalue_reference< T >::type operator*() const
counted_ptr(counted_shared_tag, T *p)
static counted_ptr< T, Atom > make_ptr(Args &&...args)
static void inc_shared_count(counted_base *base, int64_t count)
static counted_ptr< T, Atom > get_shared_ptr_from_counted_base(counted_base *base, bool inc=true)