Stacked Graphs
Geometry & Aesthetics
 All Classes Functions Variables Enumerations
stdafx.h
1 #include <QtWidgets>
2 #include <memory>
3 
4 using std::unique_ptr;
5 
6 //nullable-delete functions (https://stackoverflow.com/questions/1265666/reason-why-not-to-have-a-delete-macro-for-c)
7 template< class T > void SafeDelete( T*& pVal )
8 {
9  if(pVal)
10  {
11  delete pVal;
12  pVal = nullptr;
13  }
14 }
15 
16 template< class T > void SafeDeleteArray( T*& pVal )
17 {
18  if(pVal)
19  {
20  delete[] pVal;
21  pVal = nullptr;
22  }
23 }