From 693355f55193cb2ea4c29616073227e37665afc1 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 29 Nov 2024 17:30:45 +0100 Subject: more audio system WIP --- src/crepe/util/Private.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/crepe/util/Private.hpp') diff --git a/src/crepe/util/Private.hpp b/src/crepe/util/Private.hpp index 30c8146..d6ab23f 100644 --- a/src/crepe/util/Private.hpp +++ b/src/crepe/util/Private.hpp @@ -8,13 +8,15 @@ namespace crepe { template -void Private::set(Args &&... args) { +T & Private::set(Args &&... args) { + if (!this->empty()) this->destructor(this->instance); T * instance = new T(std::forward(args)...); this->instance = static_cast(instance); this->destructor = [](void * instance) { delete static_cast(instance); }; this->type = typeid(T); + return *instance; } template -- cgit v1.2.3