|
GiNaC 1.8.10
|
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. | |
| ptr (T &t) noexcept | |
| Bind ptr to existing reference-counted object. | |
| 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. | |
| void | swap (ptr &other) noexcept |
| Swap the bound object of this ptr with another ptr. | |
| 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 |
Bind ptr to newly created object, start reference counting.
Definition at line 66 of file ptr.h.
References GINAC_ASSERT, and p.
Referenced by get_pointer, operator!=, operator!=(), operator!=, operator<<, operator=(), operator==, operator==(), operator==, ptr(), and swap().
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 123 of file ptr.h.
References get_pointer, p, ptr(), and GiNaC::rhs().
|
inlinenoexcept |
Definition at line 126 of file ptr.h.
References get_pointer, p, ptr(), and GiNaC::rhs().
|
friend |
Definition at line 95 of file ptr.h.
References ptr().
Referenced by operator!=(), and operator==().
Definition at line 129 of file ptr.h.
References GiNaC::lhs(), ptr(), and GiNaC::rhs().
Definition at line 132 of file ptr.h.
References GiNaC::lhs(), ptr(), and GiNaC::rhs().
Definition at line 135 of file ptr.h.
References GiNaC::lhs(), ptr(), and GiNaC::rhs().
Definition at line 138 of file ptr.h.
References GiNaC::lhs(), ptr(), and GiNaC::rhs().
|
friend |
Definition at line 140 of file ptr.h.
References ptr(), and GiNaC::rhs().
|
private |
Definition at line 147 of file ptr.h.
Referenced by makewritable(), operator!=(), operator*(), operator->(), operator=(), operator==(), ptr(), ptr(), ptr(), swap(), and ~ptr().