A data type which represents a pointer to anything.
More...
#include <pointer.h>
A data type which represents a pointer to anything.
A pointer
instance encapsulates std::shared_ptr<void>
, which is essentially a reference-counted pointer to any type of data. The example below demonstrates how to use the class.
val.reset();
if (val) {
auto x = val.dereference<
float64>();
}
pointer() noexcept
Constructs a null pointer instance.
Definition: pointer.h:68
double float64
Definition: number_types.h:23
int64_t int64
Definition: number_types.h:15
◆ pointer() [1/5]
sydevs::pointer::pointer |
( |
| ) |
|
|
inlinenoexcept |
Constructs a null pointer
instance.
◆ pointer() [2/5]
sydevs::pointer::pointer |
( |
std::nullptr_t |
X | ) |
|
|
inlineexplicitnoexcept |
Constructs a null pointer
instance from a nullptr
.
◆ pointer() [3/5]
template<typename T >
sydevs::pointer::pointer |
( |
T * |
ptr | ) |
|
|
inlineexplicit |
Constructs a pointer
instance referencing the same data as ptr
.
◆ pointer() [4/5]
sydevs::pointer::pointer |
( |
const pointer & |
| ) |
|
|
defaultnoexcept |
◆ pointer() [5/5]
sydevs::pointer::pointer |
( |
pointer && |
| ) |
|
|
defaultnoexcept |
◆ ~pointer()
sydevs::pointer::~pointer |
( |
| ) |
|
|
default |
◆ dereference()
template<typename T >
T & sydevs::pointer::dereference |
|
inline |
Returns the referenced data, casting it to type T
.
◆ operator bool()
sydevs::pointer::operator bool |
( |
| ) |
const |
|
inlineexplicitnoexcept |
Returns true
if the pointer does not reference nullptr
.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ reset() [1/2]
void sydevs::pointer::reset |
( |
| ) |
|
|
inlinenoexcept |
Modifies the pointer to reference nullptr
.
◆ reset() [2/2]
template<typename T >
void sydevs::pointer::reset |
( |
T * |
ptr | ) |
|
|
inline |
Modifies the pointer to reference the same data as ptr
.
The documentation for this class was generated from the following file: