template<typename T>
bpf::memory::UniquePtr class

Template parameters
T the type of the underlying instance

Unique smart pointer

Constructors, destructors, conversion operators

UniquePtr() noexcept
UniquePtr(T* raw) noexcept
UniquePtr(UniquePtr<T>&& other) noexcept
template<typename T1>
UniquePtr(UniquePtr<T1>&& other) noexcept
~UniquePtr()

Public functions

auto operator=(UniquePtr<T>&& other) -> UniquePtr<T>& noexcept
auto operator*() const -> T& noexcept
auto operator->() const -> T* noexcept
template<typename R, typename U, typename... Args>
auto operator->*(R(U::*)(Args...) fn) const -> std::enable_if<std::is_class<U>::value && std::is_same<T, U>::value, RawMemberFunction<U, R, R(U::*)(Args...)>>::type
template<typename R, typename U, typename... Args>
auto operator->*(R(U::*)(Args...) const fn) const -> std::enable_if<std::is_class<U>::value && std::is_same<T, U>::value, RawMemberFunction<U, R, R(U::*)(Args...) const >>::type
auto Raw() const -> T* noexcept
auto operator==(const T* other) const -> bool noexcept
auto operator!=(const T* other) const -> bool noexcept
template<typename T1>
auto operator==(const UniquePtr<T1>& other) const -> bool noexcept
template<typename T1>
auto operator!=(const UniquePtr<T1>& other) const -> bool noexcept
template<typename T1>
auto Cast() -> UniquePtr<T1>

Function documentation

template<typename T>
bpf::memory::UniquePtr<T>::UniquePtr() noexcept

Constructs a null UniquePtr

template<typename T>
bpf::memory::UniquePtr<T>::UniquePtr(T* raw) noexcept

Parameters
raw pointer to wrap

Constructs an UniquePtr from a raw pointer

template<typename T>
bpf::memory::UniquePtr<T>::UniquePtr(UniquePtr<T>&& other) noexcept

Move constructor

template<typename T> template<typename T1>
bpf::memory::UniquePtr<T>::UniquePtr(UniquePtr<T1>&& other) noexcept

Move constructor

template<typename T>
UniquePtr<T>& bpf::memory::UniquePtr<T>::operator=(UniquePtr<T>&& other) noexcept

Move assignment operator

template<typename T>
T& bpf::memory::UniquePtr<T>::operator*() const noexcept

Returns reference to T

Access the wrapped object

template<typename T>
T* bpf::memory::UniquePtr<T>::operator->() const noexcept

Returns pointer to T

Access the wrapped object

template<typename T> template<typename R, typename U, typename... Args>
std::enable_if<std::is_class<U>::value && std::is_same<T, U>::value, RawMemberFunction<U, R, R(U::*)(Args...)>>::type bpf::memory::UniquePtr<T>::operator->*(R(U::*)(Args...) fn) const

Template parameters
R the function return type
U the object type which must be the same as T
Args the types of the function arguments
Parameters
fn the function pointer itself
Returns RawMemberFunction

Call a pointer to a member function on this smart pointer

template<typename T> template<typename R, typename U, typename... Args>
std::enable_if<std::is_class<U>::value && std::is_same<T, U>::value, RawMemberFunction<U, R, R(U::*)(Args...) const >>::type bpf::memory::UniquePtr<T>::operator->*(R(U::*)(Args...) const fn) const

Template parameters
R the function return type
U the object type which must be the same as T
Args the types of the function arguments
Parameters
fn the function pointer itself
Returns RawMemberFunction

Call a pointer to a member function on this smart pointer

template<typename T>
T* bpf::memory::UniquePtr<T>::Raw() const noexcept

Returns low-level raw pointer

Returns the raw pointer

template<typename T>
bool bpf::memory::UniquePtr<T>::operator==(const T* other) const noexcept

Parameters
other operand
Returns true if this equal other, false otherwise

Compare UniquePtr

template<typename T>
bool bpf::memory::UniquePtr<T>::operator!=(const T* other) const noexcept

Parameters
other operand
Returns false if this equal other, true otherwise

Compare UniquePtr

template<typename T> template<typename T1>
bool bpf::memory::UniquePtr<T>::operator==(const UniquePtr<T1>& other) const noexcept

Template parameters
T1 type to compare with
Parameters
other operand
Returns true if this equal other, false otherwise

Compare UniquePtr

template<typename T> template<typename T1>
bool bpf::memory::UniquePtr<T>::operator!=(const UniquePtr<T1>& other) const noexcept

Template parameters
T1 type to compare with
Parameters
other operand
Returns false if this equal other, true otherwise

Compare UniquePtr

template<typename T> template<typename T1>
UniquePtr<T1> bpf::memory::UniquePtr<T>::Cast()

Template parameters
T1 the type to cast to
Returns new casted UniquePtr
Exceptions
ClassCastException in debug only if the class cannot be casted

Quick casting function WARNING: ownership is transferred to the new UniquePtr