From d8507b5d10c745d7ace0d1caf0189e5bac6b7487 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sun, 20 Apr 2014 12:55:05 +0200 Subject: [PATCH] Updated CallOnExit Made it non copyable Made usage of std::function (thus allowing lambda to be used as functions) Former-commit-id: b56cb410bf94bdb3b73d73d7599059d613e41a68 --- include/Nazara/Core/CallOnExit.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/Nazara/Core/CallOnExit.hpp b/include/Nazara/Core/CallOnExit.hpp index 4d95042a6..3f8fc1f2f 100644 --- a/include/Nazara/Core/CallOnExit.hpp +++ b/include/Nazara/Core/CallOnExit.hpp @@ -8,10 +8,12 @@ #define NAZARA_CALLONEXIT_HPP #include +#include +#include -class NzCallOnExit +class NzCallOnExit : NzNonCopyable { - using Func = void (*)(); + using Func = std::function; public: NzCallOnExit(Func func = nullptr);