diff --git a/src/library/blast/strategy.cpp b/src/library/blast/strategy.cpp index dd4be53f4..c4a710cbd 100644 --- a/src/library/blast/strategy.cpp +++ b/src/library/blast/strategy.cpp @@ -93,4 +93,13 @@ optional strategy_fn::search() { trace_curr_state_if(r); } } + +strategy operator|(strategy const & s1, strategy const & s2) { + return [=]() { + if (auto r = s1()) + return r; + else + return s2(); + } +} }} diff --git a/src/library/blast/strategy.h b/src/library/blast/strategy.h index a54265757..55c46166c 100644 --- a/src/library/blast/strategy.h +++ b/src/library/blast/strategy.h @@ -41,4 +41,6 @@ public: } typedef std::function()> strategy; + +strategy operator|(strategy const & s1, strategy const & s2); }}