mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[commands] Undeprecate deferredProxy (#7417)
This changes the way deferred proxy is implemented to not use the deprecated ProxyCommand constructor. This function serves a good purpose that should be kept IMO. The constructor was confusing but this is just good syntactic sugar over `defer(() -> supplier.get().asProxy())`. Signed-off-by: Jade Turner <spacey-sooty@proton.me>
This commit is contained in:
@@ -169,15 +169,11 @@ CommandPtr Defer(wpi::unique_function<CommandPtr()> supplier,
|
||||
/**
|
||||
* Constructs a command that schedules the command returned from the supplier
|
||||
* when initialized, and ends when it is no longer scheduled. The supplier is
|
||||
* called when the command is initialized. As a replacement, consider using
|
||||
* `Defer(supplier).AsProxy()`.
|
||||
* called when the command is initialized.
|
||||
*
|
||||
* @param supplier the command supplier
|
||||
*/
|
||||
WPI_IGNORE_DEPRECATED
|
||||
[[nodiscard]] [[deprecated(
|
||||
"The ProxyCommand supplier constructor has been deprecated. Use "
|
||||
"Defer(supplier).AsProxy() instead.")]]
|
||||
[[nodiscard]]
|
||||
CommandPtr DeferredProxy(wpi::unique_function<Command*()> supplier);
|
||||
|
||||
/**
|
||||
@@ -187,11 +183,8 @@ CommandPtr DeferredProxy(wpi::unique_function<Command*()> supplier);
|
||||
*
|
||||
* @param supplier the command supplier
|
||||
*/
|
||||
[[nodiscard]] [[deprecated(
|
||||
"The ProxyCommand supplier constructor has been deprecated. Use "
|
||||
"Defer(supplier).AsProxy() instead.")]]
|
||||
[[nodiscard]]
|
||||
CommandPtr DeferredProxy(wpi::unique_function<CommandPtr()> supplier);
|
||||
WPI_UNIGNORE_DEPRECATED
|
||||
// Command Groups
|
||||
|
||||
namespace impl {
|
||||
|
||||
Reference in New Issue
Block a user