Use wpi::span instead of wpi::ArrayRef across all libraries (#3414)

- Remove ArrayRef.h
- Add SpanExtras.h for a couple of convenience functions
This commit is contained in:
Peter Johnson
2021-06-06 19:51:14 -07:00
committed by GitHub
parent 2abbbd9e70
commit 64f5413253
167 changed files with 974 additions and 1433 deletions

View File

@@ -8,7 +8,7 @@
#include <memory>
#include <vector>
#include <wpi/ArrayRef.h>
#include <wpi/span.h>
#include "frc2/command/CommandBase.h"
@@ -25,10 +25,19 @@ class CommandGroupBase : public CommandBase {
* Requires that the specified command not have been already allocated to a
* CommandGroup. Reports an error if the command is already grouped.
*
* @param commands The command to check
* @param command The command to check
* @return True if all the command is ungrouped.
*/
static bool RequireUngrouped(Command& command);
static bool RequireUngrouped(const Command& command);
/**
* Requires that the specified command not have been already allocated to a
* CommandGroup. Reports an error if the command is already grouped.
*
* @param command The command to check
* @return True if all the command is ungrouped.
*/
static bool RequireUngrouped(const Command* command);
/**
* Requires that the specified commands not have been already allocated to a
@@ -37,7 +46,7 @@ class CommandGroupBase : public CommandBase {
* @param commands The commands to check
* @return True if all the commands are ungrouped.
*/
static bool RequireUngrouped(wpi::ArrayRef<std::unique_ptr<Command>>);
static bool RequireUngrouped(wpi::span<const std::unique_ptr<Command>>);
/**
* Requires that the specified commands not have been already allocated to a
@@ -46,7 +55,7 @@ class CommandGroupBase : public CommandBase {
* @param commands The commands to check
* @return True if all the commands are ungrouped.
*/
static bool RequireUngrouped(std::initializer_list<Command*>);
static bool RequireUngrouped(std::initializer_list<const Command*>);
/**
* Adds the given commands to the command group.