| 389 | /// factory |
| 390 | template <typename G> |
| 391 | T ValueOrElse(G&& generate_alternative) && { |
| 392 | if (ok()) { |
| 393 | return MoveValueUnsafe(); |
| 394 | } |
| 395 | return std::forward<G>(generate_alternative)(); |
| 396 | } |
| 397 | |
| 398 | /// Apply a function to the internally stored value to produce a new result or propagate |
| 399 | /// the stored error. |