fixed warning

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 committed 2023-07-14 13:32:18 +03:00
1 parent b0a21c9389
commit 440afcedb0
2 files changed
+21

No files matched your search

+19
View File
@@ -18,6 +18,7 @@
#include "JavaInstall.h"
#include "BaseVersion.h"
#include "StringUtils.h"
bool JavaInstall::operator<(const JavaInstall& rhs)
@@ -43,3 +44,21 @@ bool JavaInstall::operator>(const JavaInstall& rhs)
{
return (!operator<(rhs)) && (!operator==(rhs));
}
bool JavaInstall::operator<(BaseVersion& a)
{
try {
return operator<(dynamic_cast<JavaInstall&>(a));
} catch (const std::bad_cast& e) {
return BaseVersion::operator<(a);
}
}
bool JavaInstall::operator>(BaseVersion& a)
{
try {
return operator>(dynamic_cast<JavaInstall&>(a));
} catch (const std::bad_cast& e) {
return BaseVersion::operator>(a);
}
}