KWin
Loading...
Searching...
No Matches
c_ptr.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include <memory>
12
13namespace KWin
14{
15
17{
18 template<typename T>
19 void operator()(T *ptr)
20 {
21 if (ptr) {
22 free(ptr);
23 }
24 }
25};
26
27template<typename T>
28using UniqueCPtr = std::unique_ptr<T, CDeleter>;
29
30}
std::unique_ptr< T, CDeleter > UniqueCPtr
Definition c_ptr.h:28
void operator()(T *ptr)
Definition c_ptr.h:19