33#if defined(CowPtr_RECURSES)
34#error Recursive header files inclusion detected in CowPtr.h
37#define CowPtr_RECURSES
47#include "DGtal/base/Common.h"
48#include "DGtal/base/CountedPtr.h"
117 const T*
get() const noexcept {
return myPtr.get();}
138 template < typename U = T, typename std::enable_if< ! std::is_const<U>::value >::type* =
nullptr >
141 template < typename U = T, typename std::enable_if< ! std::is_const<U>::value >::type* =
nullptr >
144 template < typename U = T, typename std::enable_if< ! std::is_const<U>::value >::type* =
nullptr >
155 return get() == other;
166 return get() != other;
188 if (!
myPtr.unique()) {
189 T* old_p =
myPtr.get();
227 template <
typename T>
236#include "DGtal/base/CowPtr.ih"
243#undef CowPtr_RECURSES
Aim: Smart pointer based on reference counts.
Aim: Copy on write shared pointer.
void selfDisplay(std::ostream &out) const
const T * operator->() const noexcept
CowPtr(const CowPtr &r) noexcept
CowPtr(const CountedPtr< T > &r, bool)
bool operator!=(const T *other) const
bool operator==(const T *other) const
unsigned int count() const
bool unique() const noexcept
const T * get() const noexcept
const T & operator*() const noexcept
CowPtr & operator=(const CowPtr &r)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)