From 767aac274b13b9d3b7e73375c44f1a5fec563a00 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Fri, 31 Oct 2014 17:36:26 -0400 Subject: Remove unused dependency --- external/glim/raii.hpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 external/glim/raii.hpp (limited to 'external/glim/raii.hpp') diff --git a/external/glim/raii.hpp b/external/glim/raii.hpp deleted file mode 100644 index a09d35776..000000000 --- a/external/glim/raii.hpp +++ /dev/null @@ -1,34 +0,0 @@ -#include -namespace glim { - -// http://stackoverflow.com/questions/2121607/any-raii-template-in-boost-or-c0x/ - -/// RAII helper. Keeps the functor and runs it in the destructor. -/// Example: \code auto unmap = raiiFun ([&]() {munmap (fd, size);}); \endcode -template struct RAIIFun { - Fun _fun; - RAIIFun (RAIIFun&&) = default; - RAIIFun (const RAIIFun&) = default; - template RAIIFun (FunArg&& fun): _fun (std::forward (fun)) {} - ~RAIIFun() {_fun();} -}; - -/// The idea to name it `finally` comes from http://www.codeproject.com/Tips/476970/finally-clause-in-Cplusplus. -/// Example: \code finally unmap ([&]() {munmap (fd, size);}); \endcode -typedef RAIIFun> finally; - -/// Runs the given functor when going out of scope. -/// Example: \code -/// auto closeFd = raiiFun ([&]() {close (fd);}); -/// auto unmap = raiiFun ([&]() {munmap (fd, size);}); -/// \endcode -template RAIIFun raiiFun (const Fun& fun) {return RAIIFun (fun);} - -/// Runs the given functor when going out of scope. -/// Example: \code -/// auto closeFd = raiiFun ([&]() {close (fd);}); -/// auto unmap = raiiFun ([&]() {munmap (fd, size);}); -/// \endcode -template RAIIFun raiiFun (Fun&& fun) {return RAIIFun (std::move (fun));} - -} -- cgit v1.2.3