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;
|
static bool run;
|
||||||
|
|
||||||
void leave(int signum);
|
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
std::cout << "Indivisible v0.1\n";
|
std::cout << "Indivisible v0.1\n";
|
||||||
run = true;
|
run = true;
|
||||||
|
|
||||||
signal(SIGINT, leave);
|
signal(SIGINT, [](int signum) {
|
||||||
|
std::cout << "Exiting (" << signum << ")\n";
|
||||||
|
run = false;
|
||||||
|
});
|
||||||
|
|
||||||
std::vector<unsigned long long> primes;
|
std::vector<unsigned long long> primes;
|
||||||
primes.push_back(2);
|
primes.push_back(2);
|
||||||
@ -49,8 +50,3 @@ int main(void) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void leave(int signum) {
|
|
||||||
std::cout << "Exiting (" << signum << ")\n";
|
|
||||||
run = false;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user