Skip to content

Commit 43efe85

Browse files
author
andrea.mancuso
committed
Switched to std::optional
1 parent 33d0c48 commit 43efe85

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

csscolorparser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ std::vector<std::string> split(const std::string& s, char delim) {
176176
return elems;
177177
}
178178

179-
optional<Color> parse(const std::string& css_str) {
179+
std::optional<Color> parse(const std::string& css_str) {
180180
std::string str = css_str;
181181

182182
// Remove all whitespace, not compliant, but should just be more accepting.

csscolorparser.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,10 @@
2727

2828
#include <string>
2929
#include <cmath>
30-
#include <experimental/optional>
30+
#include <optional>
3131

3232
namespace CSSColorParser {
3333

34-
template <class T>
35-
using optional = std::experimental::optional<T>;
36-
3734
struct Color {
3835
inline Color() {
3936
}
@@ -52,7 +49,7 @@ inline bool operator!=(const Color& lhs, const Color& rhs) {
5249
return !(lhs == rhs);
5350
}
5451

55-
optional<Color> parse(const std::string& css_str);
52+
std::optional<Color> parse(const std::string& css_str);
5653

5754
} // namespace CSSColorParser
5855

0 commit comments

Comments
 (0)