ZIPIOS_SIMPLESMARTPOINTER(3)
π NAME π
zipios::SimpleSmartPointer< Type > β bestie, this is a simple reference counting smart pointer template. That's the whole vibe. β¨
πΈ SYNOPSIS πΈ
This is a page from the Library Functions Manual, and okay so here's how you actually get to it:
#include <simplesmartptr.h>
β¨ Public Member Functions β¨
Type * operator-> () constβ arrow goes brrr, gives you the pointee.Type & operator* () constβ deref, hands you the actual object.SimpleSmartPointer (Type *p=0)β constructor, takes a raw pointer (defaults to0, ngl).template<class T2 > SimpleSmartPointer (const SimpleSmartPointer< T2 > &src)β templated copy-ish constructor, converts from aSimpleSmartPointerof another type.SimpleSmartPointer (const SimpleSmartPointer &src)β the regular copy constructor.template<class T2 > SimpleSmartPointer & operator= (const SimpleSmartPointer< T2 > &src)β templated assignment from aSimpleSmartPointer< T2 >.SimpleSmartPointer & operator= (const SimpleSmartPointer &src)β assignment from anotherSimpleSmartPointer.SimpleSmartPointer & operator= (Type *src)β assignment from a raw pointer, iconic.bool operator== (const Type *p) constβ compares against a rawType *.bool operator!= (const Type *p) constβ not-equals against a rawType *.bool operator== (const SimpleSmartPointer &sp) constβ compares against anotherSimpleSmartPointer.bool operator!= (const SimpleSmartPointer &sp) constβ not-equals against anotherSimpleSmartPointer.bool operator! () constβ the "is this thing empty" check, chef's kiss.operator void * () constβ converts tovoid *.Type * get () constβ gives you back the raw pointer, no cap.unsigned int getReferenceCount () constβ Returns the reference count - For debugging purposes. π΅οΈββοΈ
π¦ Detailed Description π¦
template<class Type>
class zipios::SimpleSmartPointer< Type >" SimpleSmartPointer is a simple
reference counting smart pointer template.
So here's the tea: the type you point at must keep a reference count that's reachable through these two methods, exactly:
void ref() constunsigned int unref() const
And not only does it have to have them β it has to handle the reference count properly. If it doesn't, that's a you problem and it will absolutely come for you. π The easiest way to do all that correctly is to just use the ReferenceCount template class. Do that. Periodt.
Definition at line 15 of file simplesmartptr.h.
π Member Function Documentation π
π template<class Type > unsigned int zipios::SimpleSmartPointer< Type >::getReferenceCount () const [inline]
Returns the reference count - For debugging purposes. That's it, that's the function. π
Definition at line 67 of file simplesmartptr.h.
π«Ά Author π«Ά
Generated automatically by Doxygen for Zipios++ from the source code. Not a human bestie typing this out, it's the machine. π€
And that's the whole page, bestie! This was Zipios++, dated Tue Mar 24 2020, and the page you're reading is zipios::SimpleSmartPointer< Type >(3). Slay, go write some reference-counted pointers. πβ¨π
π¦ where this page comes from
- ubuntu jammy: libzipios++-dev 0.1.5.9+cvs.2007.04.28-11build1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms