| 373 | template <typename T> |
| 374 | template <typename Function> |
| 375 | auto Maybe<T>::sequence(Function function) const -> decltype(function(std::declval<T>())) { |
| 376 | if (!isValid()) |
| 377 | return {}; |
| 378 | return function(get()); |
| 379 | } |
| 380 | |
| 381 | template <typename T> |
| 382 | std::ostream& operator<<(std::ostream& os, Maybe<T> const& v) { |