[*] Use std::forward args

This commit is contained in:
Reece Wilson 2021-10-18 13:53:24 +01:00
parent 1cb56fb907
commit ad182d07e0

View File

@ -12,11 +12,11 @@
#endif #endif
template<typename T, typename... Args> template<typename T, typename... Args>
static inline AuSPtr<T> AuMakeShared(Args... args) static inline AuSPtr<T> AuMakeShared(Args&&... args)
{ {
try try
{ {
return AURORA_RUNTIME_MAKE_SHARED<T>(args...); return AURORA_RUNTIME_MAKE_SHARED<T>(std::forward<Args>(args)...);
} }
catch (...) catch (...)
{ {
@ -29,9 +29,9 @@ static inline AuSPtr<T> AuMakeShared(Args... args)
#endif #endif
template<typename... Args> template<typename... Args>
static inline auto AuMakePair(Args... args) static inline auto AuMakePair(Args&&... args)
{ {
return AURORA_RUNTIME_MAKE_PAIR(args...); return AURORA_RUNTIME_MAKE_PAIR(std::forward<Args>(args)...);
} }
#if defined(AURORA_IS_MODERNNT_DERIVED) && (defined(_WINDOWS_) || defined(_OTHER_MS_MAIN_HEADER_GUARDS_HERE)) #if defined(AURORA_IS_MODERNNT_DERIVED) && (defined(_WINDOWS_) || defined(_OTHER_MS_MAIN_HEADER_GUARDS_HERE))