mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[commands] Mark CommandPtr class as [[nodiscard]] (#7803)
This has the same effect but makes it so any user code returning CommandPtr can't discard a returned command. Signed-off-by: Eric Ward <ezeward4@gmail.com>
This commit is contained in:
@@ -38,5 +38,6 @@ TEST_F(CommandPtrTest, MovedFrom) {
|
||||
}
|
||||
|
||||
TEST_F(CommandPtrTest, NullInitialization) {
|
||||
EXPECT_THROW(CommandPtr{std::unique_ptr<Command>{}}, frc::RuntimeError);
|
||||
EXPECT_THROW(auto cmd = CommandPtr{std::unique_ptr<Command>{}},
|
||||
frc::RuntimeError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user