[*] Fix construction of shared pointers with move parameters

This commit is contained in:
Reece Wilson 2023-08-20 23:51:58 +01:00
parent f25fd19726
commit 15398bdd10

View File

@ -67,16 +67,16 @@
\
using name ## Unique_t = AURORA_RUNTIME_AU_UNIQUE_PTR<type, CppDeleter ## name>; \
template <class ... T> \
name ## Unique_t name ## Unique(T... args) \
name ## Unique_t name ## Unique(T &&... args) \
{ \
return name ## Unique_t(name ## New(args...)); \
return name ## Unique_t(name ## New(AuForward<T &&>(args)...)); \
} \
\
using name ## Shared_t = AuSPtr<type>; \
template <class ... T> \
name ## Shared_t name ## Shared(T... args) \
name ## Shared_t name ## Shared(T &&... args) \
{ \
auto ptr = name ## New(args...); \
auto ptr = name ## New(AuForward<T &&>(args)...); \
if (!ptr) return {}; \
return name ## Shared_t(ptr, name ## Release); \
}