6 #include <zk/config.hpp>
17 using optional = std::optional<T>;
19 using nullopt_t = std::nullopt_t;
24 template <
typename FUnary,
typename... T>
25 auto map(FUnary&& transform,
const optional<T>&... x) -> optional<decltype(transform(x.value()...))>
28 return transform(x.value()...);
36 return optional<T>(std::move(x));
auto map(FUnary &&transform, const optional< T > &...x) -> optional< decltype(transform(x.value()...))>
Apply transform with the arguments in x iff all of them have a value. Otherwise, nullopt will be retu...