|
| | Scope (T *ptr=nullptr) noexcept |
| | Constructs an empty Scope or takes ownership of ptr.
|
| template<typename T2, typename = std::enable_if_t<std::is_base_of_v<T, T2>>> |
| | Scope (Scope< T2 > &&other) noexcept |
| | Move constructor from compatible Scope<T2>.
|
| | Scope (const Scope &)=delete |
| Scope & | operator= (const Scope &)=delete |
| | ~Scope () |
| | Destructor. Deletes managed object if not null.
|
| | Scope (Scope &&other) noexcept |
| | Move constructor.
|
| Scope & | operator= (Scope &&other) noexcept |
| | Move assignment operator.
|
| T * | Release () noexcept |
| | Releases ownership of the managed pointer.
|
| void | Reset (T *ptr=nullptr) noexcept |
| | Resets the managed pointer to ptr.
|
| T * | Get () const noexcept |
| | Gets the raw managed pointer.
|
| T & | operator* () const |
| | Dereference operator.
|
| T * | operator-> () const noexcept |
| | Arrow operator.
|
| | operator bool () const noexcept |
| | Bool conversion. True if managing a non-null pointer.
|
| constexpr bool | operator== (const Scope &other) const noexcept |
| | Equality comparison between scopes.
|
| constexpr bool | operator!= (const Scope &other) const noexcept |
| constexpr bool | operator< (const Scope &other) const noexcept |
| | Comparison operators for ordering.
|
| constexpr bool | operator<= (const Scope &other) const noexcept |
| constexpr bool | operator> (const Scope &other) const noexcept |
| constexpr bool | operator>= (const Scope &other) const noexcept |
| template<typename T2> |
| Scope< T2 > | CastTo () &&noexcept |
| | Casts this Scope to Scope<T2> when T2 is base of T.
|
template<typename T>
class Raven::Scope< T >
Exclusive-ownership smart pointer.
A minimal replacement for std::unique_ptr that uses rnew/rdelete and integrates with Raven's memory tracking. Supports move-only semantics and type-safe conversions between related types.
- Template Parameters
-
| T | The type of the managed object. |