• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1+++
2title = "Define a custom code domain"
3weight = 10
4+++
5
6Firstly let's alias the experimental Outcome namespace into something
7less tedious to type, declare our custom status code type, and get
8started on defining the custom status code domain implementation.
9
10{{% snippet "experimental_status_code.cpp" "preamble" %}}
11
12Note that we inherit from `outcome_e::posix_code::domain_type`, not
13from `outcome_e::status_code_domain`. We thus reuse most of the
14implementation of `outcome_e::posix_code::domain_type` rather than
15implementing required functionality. If you would like to see a
16fuller treatment of defining a custom status code domain from
17scratch, see [this worked example here](https://github.com/ned14/status-code/blob/master/doc/custom_domain_worked_example.md).
18
19[You may find looking at the API reference documentation for `status_code_domain`
20useful in the next few pages ](https://ned14.github.io/status-code/doc_status_code_domain.html#standardese-system_error2__status_code_domain).