• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1+++
2title = "Tying it all together"
3weight = 80
4+++
5
6Firstly let's alias a more convenient form of `status_result`:
7
8{{% snippet "experimental_status_code.cpp" "typedef" %}}
9
10(The defaulting of `default_result_policy` is superfluous, it's already the default)
11
12What follows now is very standard Outcome code. Indeed, it would compile
13just fine under standard Outcome with only a few typedefs.
14
15{{% snippet "experimental_status_code.cpp" "open_file" %}}
16
17And running this program yields:
18
19```
20Returned error has a code domain of 'file i/o error domain', a message of 'No such file or directory (c:\users\ned\documents\boostish\outcome\doc\src\snippets\experimental_status_code.cpp:195)'
21
22And semantically comparing it to 'errc::no_such_file_or_directory' = 1
23```
24
25### Conclusion
26
27Once you get used to `<system_error2>` and the fact that any `result` with
28`E = error` is always move-only, using experimental Outcome is just like
29using normal Outcome. Except that codegen will be better, custom domains
30are safe to use in headers, semantic comparisons have guaranteed complexity
31bounds, and build times are much reduced.
32
33What's not to like? :)
34
35Finally, if you have feedback on using experimental Outcome which you think
36would be of use to the standards committee when evaluating possible
37implementations of [P0709 *Zero overhead exceptions: Throwing values*](http://wg21.link/P0709),
38please do get in touch! This **especially** includes successful experiences!!!
39