GiNaC
1.8.0
|
Class of (intrusively) reference-counted pointers that support copy-on-write semantics. More...
#include <ptr.h>
Public Member Functions | |
ptr (T *t) noexcept | |
Bind ptr to newly created object, start reference counting. More... | |
ptr (T &t) noexcept | |
Bind ptr to existing reference-counted object. More... | |
ptr (const ptr &other) noexcept | |
~ptr () | |
ptr & | operator= (const ptr &other) |
T & | operator* () const noexcept |
T * | operator-> () const noexcept |
void | makewritable () |
Announce your intention to modify the object bound to this ptr. More... | |
void | swap (ptr &other) noexcept |
Swap the bound object of this ptr with another ptr. More... | |
template<class U > | |
bool | operator== (const ptr< U > &rhs) const noexcept |
template<class U > | |
bool | operator!= (const ptr< U > &rhs) const noexcept |
Private Attributes | |
T * | p |
Friends | |
struct | std::less< ptr< T > > |
T * | get_pointer (const ptr &x) noexcept |
template<class U > | |
bool | operator== (const ptr &lhs, const U *rhs) noexcept |
template<class U > | |
bool | operator!= (const ptr &lhs, const U *rhs) noexcept |
template<class U > | |
bool | operator== (const U *lhs, const ptr &rhs) noexcept |
template<class U > | |
bool | operator!= (const U *lhs, const ptr &rhs) noexcept |
std::ostream & | operator<< (std::ostream &os, const ptr< T > &rhs) |
Class of (intrusively) reference-counted pointers that support copy-on-write semantics.
Requirements for T: must support the refcounted interface (usually by being derived from refcounted) T* T::duplicate() member function (only if makewriteable() is used)
|
inlinenoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |
Definition at line 96 of file ptr.h.
Referenced by GiNaC::ptr< GiNaC::basic >::operator!=(), and GiNaC::ptr< GiNaC::basic >::operator==().
|
friend |
|
private |
Definition at line 148 of file ptr.h.
Referenced by GiNaC::ptr< GiNaC::basic >::makewritable(), GiNaC::ptr< GiNaC::basic >::operator!=(), GiNaC::ptr< GiNaC::basic >::operator*(), GiNaC::ptr< GiNaC::basic >::operator->(), GiNaC::ptr< GiNaC::basic >::operator=(), GiNaC::ptr< GiNaC::basic >::operator==(), GiNaC::ptr< GiNaC::basic >::ptr(), GiNaC::ptr< GiNaC::basic >::swap(), and GiNaC::ptr< GiNaC::basic >::~ptr().