From 1d6e68fda762535fa8508f94ca254a79f293edb2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 24 Jul 2015 16:39:55 +0200 Subject: Add support for generated test input/output --- build/target | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'build/target') diff --git a/build/target b/build/target index f5a26b4..6ee65f4 100644 --- a/build/target +++ b/build/target @@ -10,6 +10,7 @@ #include #include // unique_ptr #include // size_t +#include // uint8_t #include // reference_wrapper #include #include @@ -38,19 +39,32 @@ namespace build // Target state. // - enum class target_state + enum class target_state: std::uint8_t { - group, // Target's state is the group's state. + // The order of the enumerators is arranged so that their + // inegral values indicate whether one "overrides" the other + // in the merge operator (see below). + // unknown, - postponed, unchanged, changed, - failed + postponed, + failed, + group // Target's state is the group's state. }; std::ostream& operator<< (std::ostream&, target_state); + inline target_state& + operator |= (target_state& l, target_state r) + { + if (static_cast (r) > static_cast (l)) + l = r; + + return l; + } + // Recipe. // // The returned target state should be changed, unchanged, or -- cgit v1.1