Use C++17 <optional> in csscolorparser (#2071)

This commit is contained in:
mwilsnd
2024-01-30 14:59:44 -05:00
committed by GitHub
parent bf15332c5e
commit ea15e7b613
2 changed files with 3 additions and 4 deletions

View File

@@ -176,7 +176,7 @@ std::vector<std::string> split(const std::string& s, char delim) {
return elems;
}
std::experimental::optional<Color> parse(const std::string& css_str) {
std::optional<Color> parse(const std::string& css_str) {
std::string str = css_str;
// Remove all whitespace, not compliant, but should just be more accepting.

View File

@@ -25,8 +25,7 @@
#ifndef CSS_COLOR_PARSER_CPP
#define CSS_COLOR_PARSER_CPP
#include <optional.hpp>
#include <optional>
#include <string>
#include <cmath>
@@ -50,7 +49,7 @@ inline bool operator!=(const Color& lhs, const Color& rhs) {
return !(lhs == rhs);
}
std::experimental::optional<Color> parse(const std::string& css_str);
std::optional<Color> parse(const std::string& css_str);
} // namespace CSSColorParser