|
(Note that these are not member functions.)
|
template<class D , class DPtr > |
std::ostream & | operator<< (std::ostream &str, const RW_pointer< D, DPtr > &obj) |
|
template<class D , class DPtr > |
bool | operator== (const RW_pointer< D, DPtr > &lhs, const RW_pointer< D, DPtr > &rhs) |
|
template<class D , class DPtr > |
bool | operator== (const RW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs) |
|
template<class D , class DPtr > |
bool | operator== (const typename DPtr::PtrType &lhs, const RW_pointer< D, DPtr > &rhs) |
|
template<class D , class DPtr > |
bool | operator== (const RW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs) |
|
template<class D , class DPtr > |
bool | operator== (const typename DPtr::constPtrType &lhs, const RW_pointer< D, DPtr > &rhs) |
|
template<class D , class DPtr > |
bool | operator== (const RW_pointer< D, DPtr > &lhs, std::nullptr_t) |
|
template<class D , class DPtr > |
bool | operator== (std::nullptr_t, const RW_pointer< D, DPtr > &rhs) |
|
template<class D , class DPtr > |
bool | operator!= (const RW_pointer< D, DPtr > &lhs, const RW_pointer< D, DPtr > &rhs) |
|
template<class D , class DPtr > |
bool | operator!= (const RW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs) |
|
template<class D , class DPtr > |
bool | operator!= (const typename DPtr::PtrType &lhs, const RW_pointer< D, DPtr > &rhs) |
|
template<class D , class DPtr > |
bool | operator!= (const RW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs) |
|
template<class D , class DPtr > |
bool | operator!= (const typename DPtr::constPtrType &lhs, const RW_pointer< D, DPtr > &rhs) |
|
template<class D , class DPtr > |
bool | operator!= (const RW_pointer< D, DPtr > &lhs, std::nullptr_t) |
|
template<class D , class DPtr > |
bool | operator!= (std::nullptr_t, const RW_pointer< D, DPtr > &rhs) |
|
template<class D, class DTraits = rw_pointer::Shared<D>>
struct zypp::RW_pointer< D, DTraits >
Wrapper for const
correct access via Smart pointer types.
zypp::RW_pointer<tt><D,DTraits> stores a Smart pointer types of type DTraits::PtrType
, which must be convertible into a D *
. Pointer style access (via ->
and *
) offers a const D *
in const a context, otherwise a D *
. Thus RW_ means read/write, as you get a different type, dependent on whether you're allowed to read or write.
Forwarding access from an interface to an implemantation class, an RW_pointer prevents const interface methods from accidentally calling nonconst implementation methods.
The second template argument defaults to DTraits = rw_pointer::Shared<D>
thus wraping a shared_ptr<D>
. To wrap an intrusive_ptr<D>
use rw_pointer::Intrusive<D>
.
- See Also
- zypp::RWCOW_pointer for 'copy on write' functionality.
class Foo
{
...
private:
RW_pointer<Impl> _pimpl;
void baa() { _pimpl->... }
void baa() const { _pimpl->... }
};
Definition at line 285 of file PtrTypes.h.