-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
40 lines (33 loc) · 1.08 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
extern int Main(int argc, char const*const argv[]);
#include <string> // Bug workaround for gcc 9.2 - include before diagnostic_information.hpp
#include <boost/exception/diagnostic_information.hpp>
#include <cool/Args.h>
#include <cool/chrono.h>
#include <cool/Stopwatch.h>
#include <iostream>
int main(int argc, char* argv[])
{
using cool::chrono::system_clock::operator<<;
std::cerr
<< "Built " << __FILE__ << " on " << __DATE__ << ' ' << __TIME__
<< "\nStarted " << cool::Args(argv)
<< " at " << std::chrono::system_clock{}
<< std::endl;
cool::Stopwatch<> sw{true};
int status;
try { status = Main(argc, argv); }
catch (...)
{
std::cerr << cool::Args(argv) << '\n'
<< __PRETTY_FUNCTION__ << '\n'
<< boost::current_exception_diagnostic_information() << std::endl;
status = 1;
}
std::cerr
<< "Stopped " << cool::Args(argv)
<< " at " << std::chrono::system_clock{}
<< " (" << sw
<< ") with status=" << status
<< std::endl;
return status;
}