Post when on \a x
| 154 | } |
| 155 | /// Post when on \a x |
| 156 | virtual void post(Gecode::Space& home, Gecode::IntVarArray& x) { |
| 157 | using namespace Gecode; |
| 158 | if (sf) { |
| 159 | auto sft = static_cast<std::function<void(Space&)>> |
| 160 | ([](Space& home) { t(home); }); |
| 161 | auto sfe = static_cast<std::function<void(Space&)>> |
| 162 | ([](Space& home) { e(home); }); |
| 163 | when(home, channel(home, x[0]), sft, sfe); |
| 164 | } else { |
| 165 | when(home, channel(home, x[0]), &t, &e); |
| 166 | } |
| 167 | } |
| 168 | /// Then-function to be executed |
| 169 | static void t(Gecode::Space& home) { |
| 170 | home.fail(); |