mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
wpiutil: Replace LLVM Optional with C++17-compatible optional
Imported from https://github.com/akrzemi1/Optional with minor changes: - Compiler conditional simplifications (we only use recent versions) - Move from std::experimental to wpi namespace - Change tests to integrate with Google Test Update LLVM use cases.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#define WPIUTIL_WPI_ARRAYREF_H
|
||||
|
||||
#include "wpi/Hashing.h"
|
||||
#include "wpi/None.h"
|
||||
#include "wpi/optional.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/STLExtras.h"
|
||||
#include "wpi/Compiler.h"
|
||||
@@ -60,8 +60,8 @@ namespace wpi {
|
||||
/// Construct an empty ArrayRef.
|
||||
/*implicit*/ ArrayRef() = default;
|
||||
|
||||
/// Construct an empty ArrayRef from None.
|
||||
/*implicit*/ ArrayRef(NoneType) {}
|
||||
/// Construct an empty ArrayRef from nullopt.
|
||||
/*implicit*/ ArrayRef(nullopt_t) {}
|
||||
|
||||
/// Construct an ArrayRef from a single element.
|
||||
/*implicit*/ ArrayRef(const T &OneElt)
|
||||
@@ -296,8 +296,8 @@ namespace wpi {
|
||||
/// Construct an empty MutableArrayRef.
|
||||
/*implicit*/ MutableArrayRef() = default;
|
||||
|
||||
/// Construct an empty MutableArrayRef from None.
|
||||
/*implicit*/ MutableArrayRef(NoneType) : ArrayRef<T>() {}
|
||||
/// Construct an empty MutableArrayRef from nullopt.
|
||||
/*implicit*/ MutableArrayRef(nullopt_t) : ArrayRef<T>() {}
|
||||
|
||||
/// Construct an MutableArrayRef from a single element.
|
||||
/*implicit*/ MutableArrayRef(T &OneElt) : ArrayRef<T>(OneElt) {}
|
||||
|
||||
Reference in New Issue
Block a user