A ConstPointerTo is similar to a PointerTo, except it keeps a const pointer to the thing. More...
#include "pointerTo.h"
Public Types | |
typedef PointerToBase< T >::To | To |
Public Types inherited from PointerToBase< T > | |
typedef T | To |
Public Member Functions | |
constexpr | ConstPointerTo (std::nullptr_t) noexcept |
ConstPointerTo (const To *ptr) noexcept | |
ConstPointerTo (const PointerTo< T > ©) | |
ConstPointerTo (const ConstPointerTo< T > ©) | |
ConstPointerTo (PointerTo< T > &&from) noexcept | |
ConstPointerTo (ConstPointerTo< T > &&from) noexcept | |
template<class Y > | |
ConstPointerTo (const Y *ptr) noexcept | |
template<class Y > | |
ConstPointerTo (const PointerTo< Y > &r) noexcept | |
template<class Y > | |
ConstPointerTo (const ConstPointerTo< Y > &r) noexcept | |
template<class Y > | |
ConstPointerTo (PointerTo< Y > &&r) noexcept | |
template<class Y > | |
ConstPointerTo (ConstPointerTo< Y > &&r) noexcept | |
template<class T> | |
ConstPointerTo (const typename ConstPointerTo< T >::To *ptr) noexcept | |
const T *& | cheat () |
Returns a reference to the underlying pointer. More... | |
constexpr const To & | operator * () const noexcept |
constexpr const To * | operator -> () const noexcept |
constexpr | operator const T * () const noexcept |
We also have the typecast operator to automatically convert ConstPointerTo's to the required kind of actual pointer. More... | |
ConstPointerTo< T > & | operator= (PointerTo< T > &&from) noexcept |
ConstPointerTo< T > & | operator= (ConstPointerTo< T > &&from) noexcept |
template<class Y > | |
ConstPointerTo< T > & | operator= (const PointerTo< Y > &r) noexcept |
template<class Y > | |
ConstPointerTo< T > & | operator= (const ConstPointerTo< Y > &r) noexcept |
template<class Y > | |
ConstPointerTo< T > & | operator= (PointerTo< Y > &&r) noexcept |
template<class Y > | |
ConstPointerTo< T > & | operator= (ConstPointerTo< Y > &&r) noexcept |
ConstPointerTo< T > & | operator= (const To *ptr) |
ConstPointerTo< T > & | operator= (const PointerTo< T > ©) |
ConstPointerTo< T > & | operator= (const ConstPointerTo< T > ©) |
constexpr const To * | p () const noexcept |
Returns an ordinary pointer instead of a ConstPointerTo. More... | |
Public Member Functions inherited from PointerToBase< T > | |
void | clear () |
A convenient way to set the PointerTo object to NULL. More... | |
void | output (std::ostream &out) const |
A handy function to output PointerTo's as a hex pointer followed by a reference count. More... | |
Public Member Functions inherited from PointerToVoid | |
size_t | get_hash () const |
constexpr bool | is_null () const |
Returns true if the PointerTo is a NULL pointer, false otherwise. More... | |
bool | operator != (const PointerToVoid &other) const |
bool | operator< (const void *other) const |
bool | operator< (const PointerToVoid &other) const |
bool | operator== (const PointerToVoid &other) const |
void | swap (PointerToVoid &other) noexcept |
Swaps the contents of this PointerTo with the other, without touching the reference counts. More... | |
A ConstPointerTo is similar to a PointerTo, except it keeps a const pointer to the thing.
(Actually, it keeps a non-const pointer, because it must be allowed to adjust the reference counts, and it must be able to delete it when the reference count goes to zero. But it presents only a const pointer to the outside world.)
Notice that a PointerTo may be assigned to a ConstPointerTo, but a ConstPointerTo may not be assigned to a PointerTo.
Definition at line 144 of file pointerTo.h.
|
inline |
Returns a reference to the underlying pointer.
This is a very unsafe method. It's only used by some interrogate code. If you think this method might be useful to you, you're probably wrong.
Promise me you won't use this, okay?
Definition at line 396 of file pointerTo.I.
|
noexcept |
We also have the typecast operator to automatically convert ConstPointerTo's to the required kind of actual pointer.
This introduces ambiguities which the compiler will resolve one way or the other, but we don't care which way it goes because either will be correct.
Definition at line 383 of file pointerTo.I.
|
noexcept |
Returns an ordinary pointer instead of a ConstPointerTo.
Useful to work around compiler problems, particularly for implicit upcasts.
Definition at line 406 of file pointerTo.I.