tetl 0.1.0
Embedded Template Library
|
Compressed pointer to specified size. Intended to be used as a drop in replacement for native pointers. More...
#include <small_ptr.hpp>
Public Member Functions | |
small_ptr ()=default | |
Default construct empty small_ptr. May contain garbage. | |
small_ptr (nullptr_t null) | |
Construct from nullptr. | |
small_ptr (Type *ptr) | |
Construct from raw pointer. | |
auto | compressed_value () const noexcept -> StorageType |
Returns the compressed underlying integer address. | |
auto | get () const noexcept -> Type const * |
Returns a raw pointer to const Type. | |
auto | get () noexcept -> Type * |
Returns a raw pointer to Type. | |
operator Type * () noexcept | |
Implicit conversion to raw pointer to mutable. | |
operator Type const * () const noexcept | |
Implicit conversion to raw pointer to const. | |
auto | operator* () -> Type & |
Dereference pointer to Type&. | |
auto | operator* () const -> Type const & |
Dereference pointer to Type const&. | |
auto | operator++ () noexcept -> small_ptr & |
Post increment of pointer. | |
auto | operator++ (int) noexcept -> small_ptr |
Pre increment of pointer. | |
auto | operator- (small_ptr other) const noexcept -> ptrdiff_t |
Returns distance from this to other. | |
auto | operator-- () noexcept -> small_ptr & |
Post decrement of pointer. | |
auto | operator-- (int) noexcept -> small_ptr |
Pre decrement of pointer. | |
auto | operator-> () const -> Type * |
Returns a raw pointer to Type. | |
Compressed pointer to specified size. Intended to be used as a drop in replacement for native pointers.
Uses the base address to calculate an offset, which will be stored internally. If used on micro controllers, the base address should be set to the start of RAM. See your linker script.
|
default |
Default construct empty small_ptr. May contain garbage.
|
inline |
Construct from nullptr.
|
inline |
Construct from raw pointer.
|
inlinenodiscardnoexcept |
Returns the compressed underlying integer address.
|
inlinenodiscardnoexcept |
Returns a raw pointer to const Type.
|
inlinenodiscardnoexcept |
Returns a raw pointer to Type.
|
inlinenodiscardnoexcept |
Implicit conversion to raw pointer to mutable.
|
inlinenodiscardnoexcept |
Implicit conversion to raw pointer to const.
|
inlinenodiscard |
Dereference pointer to Type&.
|
inlinenodiscard |
Dereference pointer to Type const&.
|
inlinenodiscardnoexcept |
Post increment of pointer.
|
inlinenodiscardnoexcept |
Pre increment of pointer.
|
inlinenodiscardnoexcept |
Returns distance from this to other.
|
inlinenodiscardnoexcept |
Post decrement of pointer.
|
inlinenodiscardnoexcept |
Pre decrement of pointer.
|
inlinenodiscard |
Returns a raw pointer to Type.