From 4466aeeee69c359003925c2ab052c1546c6a40c6 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 12 Dec 2020 13:50:09 +0100 Subject: [PATCH] Fixes OptionalBorrowedPtr casts. --- src/Memory/__OptionalBorrowedPtr.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Memory/__OptionalBorrowedPtr.hpp b/src/Memory/__OptionalBorrowedPtr.hpp index 511bee4..2dddc15 100644 --- a/src/Memory/__OptionalBorrowedPtr.hpp +++ b/src/Memory/__OptionalBorrowedPtr.hpp @@ -58,12 +58,12 @@ namespace ArbUt { inline bool operator!=(T* rhs) const noexcept { return _raw != rhs; } /// @brief Returns a const version of the underlying pointer. - inline OptionalBorrowedPtr Const() const noexcept { return BorrowedPtr(_raw); } + inline OptionalBorrowedPtr Const() const noexcept { return OptionalBorrowedPtr(_raw); } /// @brief Casts the underlying pointer to another type using dynamic_cast. template inline OptionalBorrowedPtr As() const { auto cast = dynamic_cast(_raw); - return BorrowedPtr(cast); + return OptionalBorrowedPtr(cast); } /// @brief Try to cast the underlying pointer to another type using dynamic_cast. @@ -78,7 +78,7 @@ namespace ArbUt { /// @brief Force cast the underlying pointer to another type using reinterpret_cast. template inline OptionalBorrowedPtr ForceAs() const noexcept { auto cast = reinterpret_cast(_raw); - return BorrowedPtr(cast); + return OptionalBorrowedPtr(cast); } /// @brief Implicit cast to retrieve raw pointer.