本文转自:http://www.cppblog.com/johndragon/archive/2007/03/20/20209.html
#include
template
inline T * CALL_CON( T * ptMem )
{
}
template
inline void CALL_DEC( T * pt )
{
}
使用方法:
class CTest
{
public:
protected:
};
....
char testBuffer[256];
CTest * pTest = CALL_CON( (CTest*)testBuffer );
....
CALL_DEC( pTest );