[+] AuResetMember (dumb name)

This commit is contained in:
Reece Wilson 2022-08-26 13:47:17 +01:00
parent 85c85d1a1b
commit af438c8c17
3 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,28 @@
/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ResetMember.hpp
Date: 2022-08-26
Author: Reece
***/
#pragma once
template <class T>
static void AuResetMember(T &ref)
{
ref = AuDecay_t<T>();
}
template <class T>
static void AuResetMember(AuSPtr<T> &ref)
{
ref.reset();
}
namespace Aurora::Memory
{
struct ByteBuffer;
}
template <class T>
static void AuResetMember(Aurora::Memory::ByteBuffer &ref);

View File

@ -50,6 +50,7 @@
#include <auROXTL/auTryConstructUtils.hpp>
#include <auROXTL/Objects/SafeDestroy.hpp>
#include <auROXTL/Objects/ResetMember.hpp>
struct IAuNullDelegate
{
@ -64,7 +65,7 @@ struct AuNullCallback
AU_DEFINE_CTOR_ONE(AuNullCallback, (AuVoidFunc, voidFunc));
AU_DEFINE_CTOR_ONE(AuNullCallback, (AuSPtr<IAuNullDelegate>, callbackFunc));
auline void operator()()
inline void operator()()
{
if (voidFunc)
{