AuROXTL/Include/auROXTL/auListUtils.hpp

23 lines
441 B
C++
Raw Permalink Normal View History

2022-04-01 04:06:53 +00:00
/***
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>
bool AuListFromArgs(T &list, Args && ... args)
2022-04-01 04:06:53 +00:00
{
constexpr auto end = sizeof...(Args);
if (!AuTryResize(list, end))
{
return false;
}
AuUInt i = 0;
(..., (list[i++] = AuMove(args)));
return true;
}