AuROXTL/Include/auROXTL/auListUtils.hpp

23 lines
451 B
C++
Raw 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>
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;
}