Use lambda function instead.

This commit is contained in:
Nicolás A. Ortega 2016-12-01 12:35:15 +01:00
parent 05b6257e44
commit 6bfab05e37
No known key found for this signature in database
GPG Key ID: 614272579C2070D1

View File

@ -6,13 +6,14 @@
static bool run;
void leave(int signum);
int main(void) {
std::cout << "Indivisible v0.1\n";
run = true;
signal(SIGINT, leave);
signal(SIGINT, [](int signum) {
std::cout << "Exiting (" << signum << ")\n";
run = false;
});
std::vector<unsigned long long> primes;
primes.push_back(2);
@ -49,8 +50,3 @@ int main(void) {
return 0;
}
void leave(int signum) {
std::cout << "Exiting (" << signum << ")\n";
run = false;
}