?? normal.h
字號:
#ifndef normal_h
#define normal_h
#include <cassert>
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
#define READ_MEMORY( pDataSrc, type ) (*(type *)pDataSrc)
#ifdef _DEBUG
#define debug_assert( c ) assert( c )
#else
#define debug_assert( c ) 0
#endif
template <class T>
void SafeRelease( T &p )
{
if ( p != NULL )
{
p->Release();
p = NULL;
}
}
template <class T>
void SafeFree( T &p )
{
if ( p != NULL )
p->Free();
}
template <class T>
void SafeDelete( T &p )
{
if ( p != NULL )
{
delete p;
p = NULL;
}
}
template <class T>
void SafeDeleteArray( T &p )
{
if ( p != NULL )
{
delete [] p;
p = NULL;
}
}
template <class T>
void Swap( T &t1, T &t2 )
{
T temp;
temp = t1;
t1 = t2;
t2 = temp;
}
template < class T >
void QuickSort( T a[], int iSize )
{
if ( iSize <= 1 ) return;
int iEnd = iSize - 1;
T bound = a[iSize / 2];
Swap( a[0], a[iSize / 2] );
int i = 1;
while ( i <= iEnd )
{
if ( a[i] < bound )
{
Swap( a[i], a[iEnd] );
--iEnd;
}
else
{
++i;
}
}
Swap( a[0], a[i-1] );
QuickSort( &a[0], i - 1 );
QuickSort( &a[iEnd + 1], iSize - 1 - iEnd );
}
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -