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

@@ -35,7 +35,7 @@ void NTStringChooserModel::SetActive(std::string_view val) {
nt::SetEntryValue(m_active, nt::Value::MakeString(val));
}
void NTStringChooserModel::SetOptions(wpi::ArrayRef<std::string> val) {
void NTStringChooserModel::SetOptions(wpi::span<const std::string> val) {
nt::SetEntryValue(m_options, nt::Value::MakeStringArray(val));
}
@@ -63,7 +63,8 @@ void NTStringChooserModel::Update() {
if ((event.flags & NT_NOTIFY_DELETE) != 0) {
m_optionsValue.clear();
} else if (event.value && event.value->IsStringArray()) {
m_optionsValue = event.value->GetStringArray();
auto arr = event.value->GetStringArray();
m_optionsValue.assign(arr.begin(), arr.end());
}
}
}