mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 12:48:04 -06:00
Add constexpr to TriStateBool class
This commit is contained in:
committed by
sledgehammer999
parent
54e486c389
commit
b813a878d7
@@ -31,28 +31,3 @@
|
||||
const TriStateBool TriStateBool::Undefined(-1);
|
||||
const TriStateBool TriStateBool::False(0);
|
||||
const TriStateBool TriStateBool::True(1);
|
||||
|
||||
TriStateBool::operator int() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
|
||||
TriStateBool::TriStateBool(int value)
|
||||
{
|
||||
if (value < 0)
|
||||
m_value = -1;
|
||||
else if (value > 0)
|
||||
m_value = 1;
|
||||
else
|
||||
m_value = 0;
|
||||
}
|
||||
|
||||
bool TriStateBool::operator==(const TriStateBool &other) const
|
||||
{
|
||||
return (m_value == other.m_value);
|
||||
}
|
||||
|
||||
bool TriStateBool::operator!=(const TriStateBool &other) const
|
||||
{
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user