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:
Peter Johnson
2018-11-19 22:57:34 -08:00
parent 489701cacc
commit 0b03454366
14 changed files with 2494 additions and 422 deletions

View File

@@ -10,7 +10,7 @@
#ifndef WPIUTIL_WPI_NATIVE_FORMATTING_H
#define WPIUTIL_WPI_NATIVE_FORMATTING_H
#include "wpi/LLVMOptional.h"
#include "wpi/optional.h"
#include "wpi/raw_ostream.h"
#include <cstdint>
@@ -40,9 +40,9 @@ void write_integer(raw_ostream &S, long long N, size_t MinDigits,
IntegerStyle Style);
void write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
Optional<size_t> Width = None);
optional<size_t> Width = nullopt);
void write_double(raw_ostream &S, double D, FloatStyle Style,
Optional<size_t> Precision = None);
optional<size_t> Precision = nullopt);
}
#endif