Evince
Evince is a document viewer capable of displaying multiple and single page document formats like PDF and Postscript.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EvMemoryUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Igalia S.L.
3  *
4  * Evince is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Evince is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef EvMemoryUtils_h
20 #define EvMemoryUtils_h
21 
22 #include <glib.h>
23 #include <memory>
24 
25 template<typename T>
27  void operator()(T* ptr) const { g_free(ptr); }
28 };
29 
30 template<typename T>
31 using unique_gptr = std::unique_ptr<T, unique_gptr_deleter<T>>;
32 
33 #endif // EvMemoryUtils_h