#ifndef NEITHER_TRY_HPP #define NEITHER_TRY_HPP #include #include "either.hpp" namespace neither { template auto Try(F const &f, X &&... x) -> Either(x)...))> { try { return right(f(std::forward(x)...)); } catch (E const &e) { return left(e); } } } #endif