Unravel Engine C++ Reference
Loading...
Searching...
No Matches
checked_delete.h
Go to the documentation of this file.
1#pragma once
2
3// verify that types are complete for increased safety
4template<typename T>
5inline void checked_delete(T*& x)
6{
7 static_assert(sizeof(T), "Trying to delete a pointer to an incomplete type.");
8 delete x;
9 x = nullptr;
10}
11
12template<typename T>
13inline void checked_array_delete(T*& x)
14{
15 static_assert(sizeof(T), "Trying to delete a pointer to an incomplete type.");
16 delete[] x;
17 x = nullptr;
18}
19
20template<typename T>
22{
23 void operator()(T*& x) const
24 {
26 }
27};
28
29template<typename T>
31{
32 void operator()(T*& x) const
33 {
35 }
36};
void checked_array_delete(T *&x)
void checked_delete(T *&x)
float x
void operator()(T *&x) const
void operator()(T *&x) const