diff --git a/libs/main/core/piconstchars.h b/libs/main/core/piconstchars.h index 5aff7412..af99701a 100644 --- a/libs/main/core/piconstchars.h +++ b/libs/main/core/piconstchars.h @@ -130,8 +130,9 @@ public: //! \~english Compare operator. //! \~russian Оператор сравнения. inline bool operator <(const PIConstChars & s) const { - if (isNull() && s.isNull()) return false; - if (isNull() xor s.isNull()) return false; + if ( isNull() && s.isNull()) return false; + if ( isNull() && !s.isNull()) return true ; + if (!isNull() && s.isNull()) return false; if (size() == s.size()) return strcmp(str, s.str) < 0; return size() < s.size(); @@ -140,8 +141,9 @@ public: //! \~english Compare operator. //! \~russian Оператор сравнения. inline bool operator >(const PIConstChars & s) const { - if (isNull() && s.isNull()) return false; - if (isNull() xor s.isNull()) return false; + if ( isNull() && s.isNull()) return false; + if ( isNull() && !s.isNull()) return false; + if (!isNull() && s.isNull()) return true ; if (size() == s.size()) return strcmp(str, s.str) > 0; return size() > s.size(); diff --git a/main.cpp b/main.cpp index 6b1e75c0..690214fd 100644 --- a/main.cpp +++ b/main.cpp @@ -39,6 +39,8 @@ int main(int argc, char * argv[]) { cmp(PIConstChars("1c"), PIConstChars("1b"));*/ PIMap map; + map[PIConstChars()] = 0; + map[PIConstChars()] = -1; map["_2"] = 22; map["1"] = 11; map["__3"] = 33;