| 143 | // Construct an error of a certain result type. |
| 144 | template <typename Ok, typename Error> |
| 145 | result<Ok, Error> error(const Error& error) |
| 146 | { |
| 147 | result<Ok, Error> x; |
| 148 | x.ptr_error_.reset(new Error(error)); |
| 149 | return x; |
| 150 | } |
| 151 | |
| 152 | // API search type: to_maybe : Result a b -> Maybe a |
| 153 | // fwd bind count: 0 |