[*] Amend functional promise: fixed OnSuccess cast and added default template type

This commit is contained in:
Reece Wilson 2022-08-21 22:47:02 +01:00
parent 7df6614839
commit 60574f5236

View File

@ -68,14 +68,14 @@ namespace Aurora::Async
inline virtual void OnSuccess(void *in) override
{
this->OnSuccess(AuReinterpretCast<ErrorValue_t *>(in));
this->OnSuccess(AuReinterpretCast<SuccessValue_t *>(in));
}
virtual void OnFailure(ErrorValue_t *in) = 0;
virtual void OnSuccess(SuccessValue_t *in) = 0;
};
template <class SuccessValue_t, class ErrorValue_t>
template <class SuccessValue_t, class ErrorValue_t = AuNullS>
struct PromiseCallbackFunctional : PromiseCallback<SuccessValue_t, ErrorValue_t>, AuEnableSharedFromThis<PromiseCallbackFunctional<SuccessValue_t, ErrorValue_t>>
{
using OnSuccess_f = AuFunction<void(const AuSPtr<SuccessValue_t> &)>;