diff --git a/Include/auROXTL/auCastUtils.hpp b/Include/auROXTL/auCastUtils.hpp index 7671124f..f4e2f323 100644 --- a/Include/auROXTL/auCastUtils.hpp +++ b/Include/auROXTL/auCastUtils.hpp @@ -8,65 +8,59 @@ #pragma once template -AuConditional_t, T, T *> AuStaticCast(Z *other) -{ - return static_cast, T, T *>>(other); -} - -template -AuConditional_t, T, T &> AuStaticCast(Z &other) -{ - return static_cast, T, T &>>(other); -} - -template -AuConditional_t, T, T &&> AuStaticCast(Z &&other) -{ - return static_cast, T, T &&>>(other); -} - -template -T AuStaticCast(Z other) -{ - return static_cast(other); -} - -template -AuSPtr AuStaticCast(const AuSPtr &other) +static AuSPtr AuStaticCast(const AuSPtr &other) { return AuSPtr(other, static_cast(other.get())); } template -AuSPtr AuStaticCast(AuSPtr &&other) +static AuSPtr AuStaticCast(AuSPtr &&other) { return AuSPtr(AuMove(other), static_cast(other.get())); } +template +static AuConditional_t, T, T *> AuStaticCast(Z *other) +{ + return static_cast, T, T *>>(other); +} + +template::type)> +AuConditional_t, T, T &> AuStaticCast(Z &other) +{ + return static_cast, T, T &>>(other); +} + +template::type)> +static AuConditional_t, T, T &&> AuStaticCast(Z &&other) +{ + return static_cast, T, T &&>>(other); +} + +template && !AuIsPointer_v)> +static T AuStaticCast(Z other) +{ + return static_cast(other); +} + template AuConditional_t, T, T *> AuConstCast(Z *other) { return const_cast, T, T *>>(other); } -template +template::type)> AuConditional_t, T, T &> AuConstCast(Z &other) { return const_cast, T, T &>>(other); } -template +template::type)> AuConditional_t, T, T &&> AuConstCast(Z &&other) { return const_cast, T, T &&>>(other); } -template -T AuConstCast(Z other) -{ - return const_cast(other); -} - template AuSPtr AuConstCast(const AuSPtr &other) { diff --git a/Include/auROXTL/auTemplateMeta.hpp b/Include/auROXTL/auTemplateMeta.hpp index 1e86c8c8..b1db3def 100644 --- a/Include/auROXTL/auTemplateMeta.hpp +++ b/Include/auROXTL/auTemplateMeta.hpp @@ -217,7 +217,7 @@ struct is_base_of_template_impl_au template static constexpr AuTrueType test(const base *); static constexpr AuFalseType test(...); - using type = decltype(test(std::declval())); + using type = decltype(test(std::declval *>())); }; template