Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
result.hh
Go to the documentation of this file.
1#pragma once
3
4#include <boost/outcome/std_outcome.hpp>
5#include <boost/outcome/std_result.hpp>
6#include <boost/outcome/success_failure.hpp>
7#include <exception>
8
9namespace nix {
10
11template<typename T, typename E = std::exception_ptr>
12using Result = boost::outcome_v2::std_result<T, E>;
13
14template<typename T, typename D, typename E = std::exception_ptr>
15using Outcome = boost::outcome_v2::std_outcome<T, D, E>;
16
17namespace result {
18
19using boost::outcome_v2::success;
20using boost::outcome_v2::failure;
21
22inline auto current_exception()
23{
24 return failure(std::current_exception());
25}
26
27}
28
29}