Post wait on \a x
| 109 | } |
| 110 | /// Post wait on \a x |
| 111 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 112 | using namespace Gecode; |
| 113 | BoolVarArgs b(x.size()); |
| 114 | for (int i=b.size(); i--; ) |
| 115 | b[i]=channel(home,x[i]); |
| 116 | auto f = static_cast<std::function<void(Space&)>> |
| 117 | ([](Space& home) { c(home); }); |
| 118 | if (b.size() > 1) { |
| 119 | if (sf) |
| 120 | Gecode::wait(home, b, f); |
| 121 | else |
| 122 | Gecode::wait(home, b, &c); |
| 123 | } else { |
| 124 | if (sf) |
| 125 | Gecode::wait(home, b[0], f); |
| 126 | else |
| 127 | Gecode::wait(home, b[0], &c); |
| 128 | } |
| 129 | } |
| 130 | /// Continuation to be executed |
| 131 | static void c(Gecode::Space& _home) { |
| 132 | TestSpace& home = static_cast<TestSpace&>(_home); |