mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/ChatCommands: Add support for std::array-type arguments (#25261)
(cherry picked from commit 30a825e2ac)
This commit is contained in:
committed by
Shauren
parent
ed6c5c922b
commit
477618bd1f
@@ -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*>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user