Просмотр исходного кода

string.h: bug fix on operator<

undefined
Guillaume Bittoun Sam Hocevar <sam@hocevar.net> 10 лет назад
Родитель
Сommit
bfe68911d4
1 измененных файлов: 6 добавлений и 1 удалений
  1. +6
    -1
      src/lol/base/string.h

+ 6
- 1
src/lol/base/string.h Просмотреть файл

@@ -279,7 +279,12 @@ public:
inline bool operator <(String const & s) const
{
using namespace std;
return memcmp(C(), s.C(), Count()) < 0;
int res = memcmp(C(), s.C(), Count() < s.Count() ? Count() : s.Count());

if (!res)
return Count() < s.Count();

return res < 0;
}

#ifdef __GNUC__


Загрузка…
Отмена
Сохранить