{ return *this; }
static unsigned get(const SGReferenced* ref)
- { if (ref) return ++(ref->_refcount); else return ~0u; }
+ { if (ref) return ++(ref->_refcount); else return 0; }
static unsigned put(const SGReferenced* ref)
- { if (ref) return --(ref->_refcount); else return ~0u; }
+ { if (ref) return --(ref->_refcount); else return 0; }
static unsigned count(const SGReferenced* ref)
- { if (ref) return ref->_refcount; else return ~0u; }
+ { if (ref) return ref->_refcount; else return 0; }
static bool shared(const SGReferenced* ref)
{ if (ref) return 1u < ref->_refcount; else return false; }
/// The usual operations on weak pointers.
/// The interface should stay the same then what we have in Referenced.
static unsigned get(const SGWeakReferenced* ref)
- { if (ref) return ++(ref->mWeakData->mRefcount); else return 0u; }
+ { if (ref) return ++(ref->mWeakData->mRefcount); else return 0; }
static unsigned put(const SGWeakReferenced* ref)
- { if (ref) return --(ref->mWeakData->mRefcount); else return ~0u; }
+ { if (ref) return --(ref->mWeakData->mRefcount); else return 0; }
static unsigned count(const SGWeakReferenced* ref)
- { if (ref) return ref->mWeakData->mRefcount; else return 0u; }
+ { if (ref) return ref->mWeakData->mRefcount; else return 0; }
private:
/// Support for weak references, not increasing the reference count