Skip to content

Commit 3c04580

Browse files
authored
[commands] ProxyCommand: Use inner command name in unique_ptr constructor (wpilibsuite#5570)
1 parent cf19102 commit 3c04580

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ ProxyCommand::ProxyCommand(Command* command)
2323
SetName(std::string{"Proxy("}.append(command->GetName()).append(")"));
2424
}
2525

26-
ProxyCommand::ProxyCommand(std::unique_ptr<Command> command)
27-
: ProxyCommand([command = std::move(command)] { return command.get(); }) {}
26+
ProxyCommand::ProxyCommand(std::unique_ptr<Command> command) {
27+
SetName(std::string{"Proxy("}.append(command->GetName()).append(")"));
28+
m_supplier = [command = std::move(command)] { return command.get(); };
29+
}
2830

2931
void ProxyCommand::Initialize() {
3032
m_command = m_supplier();

0 commit comments

Comments
 (0)