From 7b179f8bd9b2292f66188ddb47ae6cf824d7a94a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 6 Apr 2018 11:30:10 +0100 Subject: C++17 Remove intrusivePtrBase. --- libadhocutil/intrusivePtrBase.h | 45 ----------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 libadhocutil/intrusivePtrBase.h diff --git a/libadhocutil/intrusivePtrBase.h b/libadhocutil/intrusivePtrBase.h deleted file mode 100644 index 327ac5a..0000000 --- a/libadhocutil/intrusivePtrBase.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ADHOCUTIL_INTRUSIVEPTRBASE_H -#define ADHOCUTIL_INTRUSIVEPTRBASE_H - -#include - -/// Base class suitable for use with boost::intrusive_ptr. -class IntrusivePtrBase { - protected: - /// @cond - inline IntrusivePtrBase() : _refCount(0) { } - inline virtual ~IntrusivePtrBase() = 0; - - mutable unsigned int _refCount; - friend void intrusive_ptr_release(const IntrusivePtrBase * p); - friend void intrusive_ptr_add_ref(const IntrusivePtrBase * p); - private: - IntrusivePtrBase(const IntrusivePtrBase &) = delete; - void operator=(const IntrusivePtrBase &) = delete; -}; - -inline -IntrusivePtrBase::~IntrusivePtrBase() = default; - -inline -void -intrusive_ptr_release(const IntrusivePtrBase * p) -{ - if (p->_refCount == 1) { - delete p; - } - else { - p->_refCount -= 1; - } -} - -inline -void -intrusive_ptr_add_ref(const IntrusivePtrBase * p) -{ - p->_refCount += 1; -} -/// @endcond - -#endif - -- cgit v1.2.3