| 70 | |
| 71 | |
| 72 | ACTION_TEMPLATE(PromiseArg, |
| 73 | HAS_1_TEMPLATE_PARAMS(int, k), |
| 74 | AND_1_VALUE_PARAMS(promise)) |
| 75 | { |
| 76 | // TODO(benh): Use a shared_ptr for promise to defend against this |
| 77 | // action getting invoked more than once (e.g., used via |
| 78 | // WillRepeatedly). We won't be able to set it a second time but at |
| 79 | // least we won't get a segmentation fault. We could also consider |
| 80 | // warning users if they attempted to set it more than once. |
| 81 | promise->set(std::get<k>(args)); |
| 82 | delete promise; |
| 83 | } |
| 84 | |
| 85 | |
| 86 | template <int index, typename T> |