summaryrefslogtreecommitdiff
path: root/modules/lang/examples/c_example.cpp
blob: f15db93bf5f0ffc2a8b961bbe27e1a4e410abb54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <forstio/error.hpp>

saw::error_or<void> real_main(int argc, char** argv){
	using namespace saw;
	return make_void();
}

int main(int argc, char** argv){
	auto eov = real_main(argc, argv);
	if(eov.is_error()){
		auto& err = eov.get_error();
		std::cerr<<"Error: "<<err.get_category()<<" - "<<err.get_message();
		return err.get_id();
	}

	return 0;
}