Use lambda function instead.
This commit is contained in:
parent
05b6257e44
commit
6bfab05e37
12
src/Main.cpp
12
src/Main.cpp
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user