template<typename T>
UniquePtr class
| Template parameters | |
|---|---|
| T | the type of the underlying instance |
Contents
Unique smart pointer
Constructors, destructors, conversion operators
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>
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