Skip to content

Commit 235efa1

Browse files
committed
fix
1 parent 39d4f1b commit 235efa1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

util/str_stl.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ struct TEqualTo<TUtf32String>: public TEqualTo<TUtf32StringBuf> {
211211
using is_transparent = void;
212212
};
213213

214+
template <>
215+
struct TEqualTo<const char*> {
216+
inline bool operator()(const char* a, const char* b) const {
217+
return strcmp(a, b) == 0;
218+
}
219+
};
220+
214221
template <class TFirst, class TSecond>
215222
struct TEqualTo<std::pair<TFirst, TSecond>> {
216223
template <class TOther>
@@ -264,6 +271,13 @@ struct TLess<TUtf32String>: public TLess<TUtf32StringBuf> {
264271
using is_transparent = void;
265272
};
266273

274+
template <>
275+
struct TLess<const char*> {
276+
inline bool operator()(const char* a, const char* b) const {
277+
return strcmp(a, b) < 0;
278+
}
279+
};
280+
267281
template <class T>
268282
struct TGreater: public std::greater<T> {
269283
};

0 commit comments

Comments
 (0)