MacStd
OS X API using Standard C++
Loading...
Searching...
No Matches
CoreFoundation.hpp
1/*
2 SPDX-License-Identifier: MIT
3 Copyright © 2023-2024 Amebis
4*/
5
6#pragma once
7
8#include "common.hpp"
9#include <CoreFoundation/CoreFoundation.h>
10#include <memory>
11
12namespace macstd {
17 {
21 CFRelease_delete() noexcept {}
22
28 template <class _T>
29 void operator()(_T *_Ptr) const
30 {
31 CFRelease(_Ptr);
32 }
33 };
34
39 template <class T>
40 using CFType = std::unique_ptr<T, CFRelease_delete>;
41}
Deleter for unique_ptr using CFRelease.
Definition CoreFoundation.hpp:17
CFRelease_delete() noexcept
Default constructor.
Definition CoreFoundation.hpp:21
void operator()(_T *_Ptr) const
Delete a pointer.
Definition CoreFoundation.hpp:29