File indexing completed on 2024-07-14 14:38:29

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-or-later
0006 */
0007 #pragma once
0008 #include <memory>
0009 
0010 struct CDeleter {
0011     template<typename T>
0012     void operator()(T *ptr)
0013     {
0014         free(ptr);
0015     }
0016 };
0017 template<typename T>
0018 using UniqueCPointer = std::unique_ptr<T, CDeleter>;