From 6bfab05e3773127ce7742da7f97dd5d7023e67e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega?= Date: Thu, 1 Dec 2016 12:35:15 +0100 Subject: [PATCH] Use lambda function instead. --- src/Main.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index a423803..ee10780 100644 --- a/src/Main.cpp +++ b/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 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; -}