Util: Change operators to the evaluated order
This commit is contained in:
+4
-4
@@ -100,12 +100,12 @@ System System::operator|(System rhs)
|
||||
return rhs;
|
||||
}
|
||||
|
||||
System System::operator||(System rhs)
|
||||
System System::operator&&(System rhs)
|
||||
{
|
||||
auto lhs = *this;
|
||||
|
||||
lhs.exec();
|
||||
if (lhs.m_status == 0) {
|
||||
if (lhs.m_status > 0) {
|
||||
return lhs;
|
||||
}
|
||||
|
||||
@@ -116,12 +116,12 @@ System System::operator||(System rhs)
|
||||
return rhs;
|
||||
}
|
||||
|
||||
System System::operator&&(System rhs)
|
||||
System System::operator||(System rhs)
|
||||
{
|
||||
auto lhs = *this;
|
||||
|
||||
lhs.exec();
|
||||
if (lhs.m_status > 0) {
|
||||
if (lhs.m_status == 0) {
|
||||
return lhs;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -29,10 +29,12 @@ public:
|
||||
System operator()(const std::vector<std::string>& arguments);
|
||||
System operator()(const std::vector<std::string_view>& arguments);
|
||||
|
||||
// Operator order
|
||||
// + -> | -> && -> ||
|
||||
System operator+(System rhs);
|
||||
System operator|(System rhs);
|
||||
System operator||(System rhs);
|
||||
System operator&&(System rhs);
|
||||
System operator||(System rhs);
|
||||
|
||||
void print(const std::vector<std::string>& arguments);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user