aboutsummaryrefslogtreecommitdiff
path: root/build/operation
diff options
context:
space:
mode:
Diffstat (limited to 'build/operation')
-rw-r--r--build/operation14
1 files changed, 14 insertions, 0 deletions
diff --git a/build/operation b/build/operation
index 75d6526..6fde9fd 100644
--- a/build/operation
+++ b/build/operation
@@ -79,6 +79,19 @@ namespace build
action_id outer_id;
};
+ // This is an "overrides" comparison, i.e., it returns true
+ // if the recipe for x overrides recipe for y. The idea is
+ // that for the same inner operation, action with an outer
+ // operation is "weaker" than the one without.
+ //
+ inline bool
+ operator> (action x, action y)
+ {
+ return x.inner_id != y.inner_id ||
+ (x.outer_id != y.outer_id && y.outer_id != 0);
+ }
+
+ /*
inline bool
operator== (action x, action y)
{
@@ -87,6 +100,7 @@ namespace build
inline bool
operator!= (action x, action y) {return !(x == y);}
+ */
std::ostream&
operator<< (std::ostream&, action);