mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Upgrade to C++20 (#4239)
* Use explicit this capture required by C++20 * Use C++20 span * Replace wpi::numbers with std::numbers * Fix C++20 clang-tidy warning false positive in fmt * Remove ciso646 include since C++20 removed that header * Fix global-buffer-overflow asan warnings in ntcore tests * Add DIOSetProxy constructor to HAL * Upgrade MSVC compiler to 2022 * Bump native-utils to 2023.2.7 (changes to std=c++20) Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
This commit is contained in:
@@ -6,12 +6,12 @@
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/span.h"
|
||||
|
||||
namespace wpi {
|
||||
|
||||
@@ -112,7 +112,7 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddBooleanArrayProperty(
|
||||
std::string_view key, std::function<std::vector<int>()> getter,
|
||||
std::function<void(wpi::span<const int>)> setter) = 0;
|
||||
std::function<void(std::span<const int>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add an integer array property.
|
||||
@@ -123,7 +123,7 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddIntegerArrayProperty(
|
||||
std::string_view key, std::function<std::vector<int64_t>()> getter,
|
||||
std::function<void(wpi::span<const int64_t>)> setter) = 0;
|
||||
std::function<void(std::span<const int64_t>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a float array property.
|
||||
@@ -134,7 +134,7 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddFloatArrayProperty(
|
||||
std::string_view key, std::function<std::vector<float>()> getter,
|
||||
std::function<void(wpi::span<const float>)> setter) = 0;
|
||||
std::function<void(std::span<const float>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a double array property.
|
||||
@@ -145,7 +145,7 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddDoubleArrayProperty(
|
||||
std::string_view key, std::function<std::vector<double>()> getter,
|
||||
std::function<void(wpi::span<const double>)> setter) = 0;
|
||||
std::function<void(std::span<const double>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a string array property.
|
||||
@@ -156,7 +156,7 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddStringArrayProperty(
|
||||
std::string_view key, std::function<std::vector<std::string>()> getter,
|
||||
std::function<void(wpi::span<const std::string>)> setter) = 0;
|
||||
std::function<void(std::span<const std::string>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a raw property.
|
||||
@@ -169,7 +169,7 @@ class SendableBuilder {
|
||||
virtual void AddRawProperty(
|
||||
std::string_view key, std::string_view typeString,
|
||||
std::function<std::vector<uint8_t>()> getter,
|
||||
std::function<void(wpi::span<const uint8_t>)> setter) = 0;
|
||||
std::function<void(std::span<const uint8_t>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a string property (SmallString form).
|
||||
@@ -192,9 +192,9 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddSmallBooleanArrayProperty(
|
||||
std::string_view key,
|
||||
std::function<wpi::span<const int>(wpi::SmallVectorImpl<int>& buf)>
|
||||
std::function<std::span<const int>(wpi::SmallVectorImpl<int>& buf)>
|
||||
getter,
|
||||
std::function<void(wpi::span<const int>)> setter) = 0;
|
||||
std::function<void(std::span<const int>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add an integer array property (SmallVector form).
|
||||
@@ -206,9 +206,9 @@ class SendableBuilder {
|
||||
virtual void AddSmallIntegerArrayProperty(
|
||||
std::string_view key,
|
||||
std::function<
|
||||
wpi::span<const int64_t>(wpi::SmallVectorImpl<int64_t>& buf)>
|
||||
std::span<const int64_t>(wpi::SmallVectorImpl<int64_t>& buf)>
|
||||
getter,
|
||||
std::function<void(wpi::span<const int64_t>)> setter) = 0;
|
||||
std::function<void(std::span<const int64_t>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a float array property (SmallVector form).
|
||||
@@ -219,9 +219,9 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddSmallFloatArrayProperty(
|
||||
std::string_view key,
|
||||
std::function<wpi::span<const float>(wpi::SmallVectorImpl<float>& buf)>
|
||||
std::function<std::span<const float>(wpi::SmallVectorImpl<float>& buf)>
|
||||
getter,
|
||||
std::function<void(wpi::span<const float>)> setter) = 0;
|
||||
std::function<void(std::span<const float>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a double array property (SmallVector form).
|
||||
@@ -232,9 +232,9 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddSmallDoubleArrayProperty(
|
||||
std::string_view key,
|
||||
std::function<wpi::span<const double>(wpi::SmallVectorImpl<double>& buf)>
|
||||
std::function<std::span<const double>(wpi::SmallVectorImpl<double>& buf)>
|
||||
getter,
|
||||
std::function<void(wpi::span<const double>)> setter) = 0;
|
||||
std::function<void(std::span<const double>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a string array property (SmallVector form).
|
||||
@@ -246,9 +246,9 @@ class SendableBuilder {
|
||||
virtual void AddSmallStringArrayProperty(
|
||||
std::string_view key,
|
||||
std::function<
|
||||
wpi::span<const std::string>(wpi::SmallVectorImpl<std::string>& buf)>
|
||||
std::span<const std::string>(wpi::SmallVectorImpl<std::string>& buf)>
|
||||
getter,
|
||||
std::function<void(wpi::span<const std::string>)> setter) = 0;
|
||||
std::function<void(std::span<const std::string>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Add a raw property (SmallVector form).
|
||||
@@ -260,9 +260,9 @@ class SendableBuilder {
|
||||
*/
|
||||
virtual void AddSmallRawProperty(
|
||||
std::string_view key, std::string_view typeString,
|
||||
std::function<wpi::span<uint8_t>(wpi::SmallVectorImpl<uint8_t>& buf)>
|
||||
std::function<std::span<uint8_t>(wpi::SmallVectorImpl<uint8_t>& buf)>
|
||||
getter,
|
||||
std::function<void(wpi::span<const uint8_t>)> setter) = 0;
|
||||
std::function<void(std::span<const uint8_t>)> setter) = 0;
|
||||
|
||||
/**
|
||||
* Gets the kind of backend being used.
|
||||
|
||||
Reference in New Issue
Block a user