yo/advancedtemplates/examples/errcode/systemcat/main.cc
raw| 1 | #include <iostream> |
| 2 | #include <system_error> |
| 3 | #include <string> |
| 4 | |
| 5 | using namespace std; |
| 6 | |
| 7 | int main() |
| 8 | { |
| 9 | error_code ec( (int)errc::address_in_use, system_category() ); |
| 10 | |
| 11 | cout << ec.value() << '\n'; |
| 12 | cout << ec.default_error_condition().value() << '\n'; |
| 13 | cout << ec.category().name() << '\n'; |
| 14 | } |