2 #ifndef SYDEVS_POINTER_H_
3 #define SYDEVS_POINTER_H_
39 explicit pointer(std::nullptr_t X) noexcept;
53 void reset() noexcept;
61 explicit operator
bool() const noexcept;
64 std::shared_ptr<
void> ptr_;
103 if (!ptr_)
throw std::logic_error(
"Attempt to dereference null pointer object");
104 return *
static_cast<T*
>(ptr_.get());
108 inline pointer::operator bool() const noexcept
A data type which represents a pointer to anything.
Definition: pointer.h:29
pointer(const pointer &) noexcept=default
Copy constructor.
void reset() noexcept
Modifies the pointer to reference nullptr.
Definition: pointer.h:87
pointer & operator=(const pointer &) noexcept=default
Copy assignment.
pointer(pointer &&) noexcept=default
Move constructor.
pointer() noexcept
Constructs a null pointer instance.
Definition: pointer.h:68
T & dereference() const
Returns the referenced data, casting it to type T.
Definition: pointer.h:101
Definition: arraynd.h:1211