| 222 | |
| 223 | template <typename T> |
| 224 | std::future_status GenericFuture<T>::waitFor(std::chrono::milliseconds timeMs) const |
| 225 | { |
| 226 | return std::visit(Overloaded { |
| 227 | [&](const ThreadContextPtr<T>& ctx)->decltype(auto) { |
| 228 | if (local::context()) { |
| 229 | return cast::context<T>(ctx)->waitFor(local::context(), timeMs); |
| 230 | } |
| 231 | else { |
| 232 | return ctx->waitFor(timeMs); |
| 233 | } |
| 234 | }, |
| 235 | [&](const ThreadFuturePtr<T>& ctx)->decltype(auto) { |
| 236 | if (local::context()) { |
| 237 | return cast::context<T>(ctx)->waitFor(local::context(), timeMs); |
| 238 | } |
| 239 | else { |
| 240 | return ctx->waitFor(timeMs); |
| 241 | } |
| 242 | }, |
| 243 | [&, this](const CoroContextPtr<T>& ctx)->decltype(auto) { |
| 244 | if (local::context()) { |
| 245 | return ctx->waitFor(_sync ? _sync : local::context(), timeMs); |
| 246 | } |
| 247 | else { |
| 248 | return cast::context<T>(ctx)->waitFor(timeMs); |
| 249 | } |
| 250 | }, |
| 251 | [&, this](const CoroFuturePtr<T>& ctx)->decltype(auto) { |
| 252 | if (local::context()) { |
| 253 | return ctx->waitFor(_sync ? _sync : local::context(), timeMs); |
| 254 | } |
| 255 | else { |
| 256 | return cast::context<T>(ctx)->waitFor(timeMs); |
| 257 | } |
| 258 | } |
| 259 | }, _context); |
| 260 | } |
| 261 | |
| 262 | template <typename T> |
| 263 | template <typename V> |
no test coverage detected