[commands] Move SelectCommand factory impl to header (#4581)

It's templated, so it needs to be in the header.
This commit is contained in:
Starlight220
2022-11-08 01:49:36 +02:00
committed by GitHub
parent 323524fed6
commit 7d06e517e9
2 changed files with 6 additions and 10 deletions

View File

@@ -14,7 +14,6 @@
#include "frc2/command/PrintCommand.h"
#include "frc2/command/ProxyScheduleCommand.h"
#include "frc2/command/RunCommand.h"
#include "frc2/command/SelectCommand.h"
#include "frc2/command/SequentialCommandGroup.h"
#include "frc2/command/WaitCommand.h"
#include "frc2/command/WaitUntilCommand.h"
@@ -100,14 +99,6 @@ CommandPtr cmd::Either(CommandPtr&& onTrue, CommandPtr&& onFalse,
.ToPtr();
}
template <typename Key>
CommandPtr cmd::Select(std::function<Key()> selector,
std::vector<std::pair<Key, CommandPtr>> commands) {
return SelectCommand(std::move(selector),
CommandPtr::UnwrapVector(std::move(commands)))
.ToPtr();
}
CommandPtr cmd::Sequence(std::vector<CommandPtr>&& commands) {
return SequentialCommandGroup(CommandPtr::UnwrapVector(std::move(commands)))
.ToPtr();