Replace wpi::optional with C++17 std::optional (#1732)

Keep wpi/optional.h as a shim with deprecated warnings.
This commit is contained in:
Peter Johnson
2019-06-29 11:20:22 -07:00
committed by GitHub
parent 0fbb0d989e
commit 4b1b92bb74
11 changed files with 52 additions and 2490 deletions

View File

@@ -132,7 +132,7 @@ void wpi::write_integer(raw_ostream &S, long long N, size_t MinDigits,
}
void wpi::write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
optional<size_t> Width) {
std::optional<size_t> Width) {
const size_t kMaxWidth = 128u;
size_t W = std::min(kMaxWidth, Width.value_or(0u));
@@ -162,7 +162,7 @@ void wpi::write_hex(raw_ostream &S, uint64_t N, HexPrintStyle Style,
}
void wpi::write_double(raw_ostream &S, double N, FloatStyle Style,
optional<size_t> Precision) {
std::optional<size_t> Precision) {
size_t Prec = Precision.value_or(getDefaultPrecision(Style));
if (std::isnan(N)) {