Skip to content

Commit

Permalink
Use C++17 <optional> in csscolorparser (#2071)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilsnd authored Jan 30, 2024
1 parent bf15332 commit ea15e7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vendor/csscolorparser/csscolorparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions vendor/csscolorparser/csscolorparser/csscolorparser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#ifndef CSS_COLOR_PARSER_CPP
#define CSS_COLOR_PARSER_CPP

#include <optional.hpp>

#include <optional>
#include <string>
#include <cmath>

Expand All @@ -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

Expand Down

0 comments on commit ea15e7b

Please sign in to comment.