Fixed cast functions on BorrowedPtr being invalid.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-05-26 19:40:08 +02:00
parent 90bda57d79
commit 0b740ee24d
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 3 additions and 3 deletions

View File

@ -33,12 +33,12 @@ namespace ArbUt {
[[nodiscard]] inline constexpr bool IsNull() const noexcept { return _raw == nullptr; }
template <class TCast> inline BorrowedPtr<TCast> As() const {
auto cast = dynamic_cast<TCast>(_raw);
auto cast = dynamic_cast<TCast*>(_raw);
return BorrowedPtr<TCast>(cast);
}
template <class TCast> inline bool TryAs(BorrowedPtr<TCast>& out) const {
auto cast = dynamic_cast<TCast>(_raw);
auto cast = dynamic_cast<TCast*>(_raw);
if (cast == nullptr)
return false;
out = BorrowedPtr<TCast>(cast);
@ -46,7 +46,7 @@ namespace ArbUt {
}
template <class TCast> inline BorrowedPtr<TCast> ForceAs() const {
auto cast = reinterpret_cast<TCast>(_raw);
auto cast = reinterpret_cast<TCast*>(_raw);
return BorrowedPtr<TCast>(cast);
}
};