Files
OpenVulkano/openVulkanoCpp/Base/Wrapper.hpp

25 lines
612 B
C++

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <memory>
namespace OpenVulkano
{
template<typename T> using Ptr = std::shared_ptr<T>;
template<typename T> using Weak = std::weak_ptr<T>;
template<typename T> using Unique = std::unique_ptr<T>;
template<typename T = void>
struct FreeDelete
{
void operator()(T* x) const { free(x); }
};
template<typename T> using UniqueMalloc = std::unique_ptr<T, FreeDelete<T>>;
}