Skip to content
Snippets Groups Projects
Commit 7f25b8ba authored by Jan Trávníček's avatar Jan Trávníček
Browse files

fix operator < in strings

parent c7bf5b5d
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ bool CyclicString::operator<(const LinearString& other) const {
}
 
bool CyclicString::operator<(const CyclicString& other) const {
return m_Data < other.m_Data;
return std::tie(m_Data, alphabet) < std::tie(other.m_Data, other.alphabet);
}
 
bool CyclicString::operator<(const Epsilon& other) const {
......
......@@ -50,8 +50,8 @@ bool Epsilon::isEmpty() const {
return true;
}
 
bool Epsilon::operator<(const Epsilon&) const {
return false;
bool Epsilon::operator<(const Epsilon& other) const {
return alphabet < other.alphabet;
}
 
bool Epsilon::operator<(const LinearString& other) const {
......
......@@ -101,7 +101,7 @@ bool LinearString::isEmpty() const {
}
 
bool LinearString::operator<(const LinearString& other) const {
return m_Data < other.m_Data;
return std::tie(m_Data, alphabet) < std::tie(other.m_Data, other.alphabet);
}
 
bool LinearString::operator<(const CyclicString& other) const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment