|
12 | 12 | #include <iostream> |
13 | 13 | #include <algorithm> |
14 | 14 | #include <memory> |
15 | | -#include <boost/algorithm/string/predicate.hpp> |
16 | | -#include <boost/operators.hpp> |
17 | 15 | #include <vector> |
18 | 16 | #include <cmath> |
19 | 17 |
|
@@ -116,7 +114,7 @@ namespace crow |
116 | 114 | namespace detail |
117 | 115 | { |
118 | 116 | /// A read string implementation with comparison functionality. |
119 | | - struct r_string : boost::less_than_comparable<r_string>, boost::less_than_comparable<r_string, std::string>, boost::equality_comparable<r_string>, boost::equality_comparable<r_string, std::string> |
| 117 | + struct r_string |
120 | 118 | { |
121 | 119 | r_string(){}; |
122 | 120 | r_string(char* s, char* e): |
@@ -189,27 +187,57 @@ namespace crow |
189 | 187 |
|
190 | 188 | inline bool operator<(const r_string& l, const r_string& r) |
191 | 189 | { |
192 | | - return boost::lexicographical_compare(l, r); |
| 190 | + return std::lexicographical_compare(l.begin(), l.end(), r.begin(), r.end()); |
193 | 191 | } |
194 | 192 |
|
195 | 193 | inline bool operator<(const r_string& l, const std::string& r) |
196 | 194 | { |
197 | | - return boost::lexicographical_compare(l, r); |
| 195 | + return std::lexicographical_compare(l.begin(), l.end(), r.begin(), r.end()); |
| 196 | + } |
| 197 | + |
| 198 | + inline bool operator<(const std::string& l, const r_string& r) |
| 199 | + { |
| 200 | + return std::lexicographical_compare(l.begin(), l.end(), r.begin(), r.end()); |
198 | 201 | } |
199 | 202 |
|
200 | 203 | inline bool operator>(const r_string& l, const std::string& r) |
201 | 204 | { |
202 | | - return boost::lexicographical_compare(r, l); |
| 205 | + return std::lexicographical_compare(l.begin(), l.end(), r.begin(), r.end()); |
| 206 | + } |
| 207 | + |
| 208 | + inline bool operator>(const std::string& l, const r_string& r) |
| 209 | + { |
| 210 | + return std::lexicographical_compare(l.begin(), l.end(), r.begin(), r.end()); |
203 | 211 | } |
204 | 212 |
|
205 | 213 | inline bool operator==(const r_string& l, const r_string& r) |
206 | 214 | { |
207 | | - return boost::equals(l, r); |
| 215 | + return std::equal(l.begin(), l.end(), r.begin(), r.end()); |
208 | 216 | } |
209 | 217 |
|
210 | 218 | inline bool operator==(const r_string& l, const std::string& r) |
211 | 219 | { |
212 | | - return boost::equals(l, r); |
| 220 | + return std::equal(l.begin(), l.end(), r.begin(), r.end()); |
| 221 | + } |
| 222 | + |
| 223 | + inline bool operator==(const std::string& l, const r_string& r) |
| 224 | + { |
| 225 | + return std::equal(l.begin(), l.end(), r.begin(), r.end()); |
| 226 | + } |
| 227 | + |
| 228 | + inline bool operator!=(const r_string& l, const r_string& r) |
| 229 | + { |
| 230 | + return !(l == r); |
| 231 | + } |
| 232 | + |
| 233 | + inline bool operator!=(const r_string& l, const std::string& r) |
| 234 | + { |
| 235 | + return !(l == r); |
| 236 | + } |
| 237 | + |
| 238 | + inline bool operator!=(const std::string& l, const r_string& r) |
| 239 | + { |
| 240 | + return !(l == r); |
213 | 241 | } |
214 | 242 | } // namespace detail |
215 | 243 |
|
|
0 commit comments