AuROXTL/Include/auROXTL/auListUtils.hpp
2022-04-01 05:06:53 +01:00

23 lines
451 B
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: auListUtils.hpp
Date: 2022-3-27
Author: Reece
***/
#pragma once
template <typename T, typename ... Args>
constexpr bool AuListFromArgs(T &list, Args && ... args)
{
constexpr auto end = sizeof...(Args);
if (!AuTryResize(list, end))
{
return false;
}
AuUInt i = 0;
(..., (list[i++] = AuMove(args)));
return true;
}