Core/ChatCommands: Add support for std::array-type arguments (#25261)

(cherry picked from commit 30a825e2ac)
This commit is contained in:
Peter Keresztes Schmidt
2020-08-17 00:15:53 +02:00
committed by Shauren
parent ed6c5c922b
commit 477618bd1f

View File

@@ -86,6 +86,23 @@ struct CommandArgsConsumerSingle<std::vector<T>>
}
};
template <typename T, std::size_t C>
struct CommandArgsConsumerSingle<std::array<T, C>>
{
static char const* TryConsumeTo(std::array<T, C>& val, char const* args)
{
for (T& t : val)
{
args = CommandArgsConsumerSingle<T>::TryConsumeTo(t, args);
if (!args)
return nullptr;
}
return args;
}
};
template <>
struct CommandArgsConsumerSingle<CommandArgs*>
{