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

@@ -6,7 +6,7 @@
using namespace frc2;
bool CommandGroupBase::RequireUngrouped(Command& command) {
bool CommandGroupBase::RequireUngrouped(const Command& command) {
if (command.IsGrouped()) {
throw FRC_MakeError(
frc::err::CommandIllegalUse, "{}",
@@ -15,8 +15,12 @@ bool CommandGroupBase::RequireUngrouped(Command& command) {
return true;
}
bool CommandGroupBase::RequireUngrouped(const Command* command) {
return RequireUngrouped(*command);
}
bool CommandGroupBase::RequireUngrouped(
wpi::ArrayRef<std::unique_ptr<Command>> commands) {
wpi::span<const std::unique_ptr<Command>> commands) {
bool allUngrouped = true;
for (auto&& command : commands) {
allUngrouped &= !command.get()->IsGrouped();
@@ -30,7 +34,7 @@ bool CommandGroupBase::RequireUngrouped(
}
bool CommandGroupBase::RequireUngrouped(
std::initializer_list<Command*> commands) {
std::initializer_list<const Command*> commands) {
bool allUngrouped = true;
for (auto&& command : commands) {
allUngrouped &= !command->IsGrouped();