template < bool > struct SizeGuard { private: SizeGuard() {} }; //这里定义好通常结构 template <> struct SizeGuard < true > { SizeGuard( LPCSTR ) {} }; // 这里设置好条件 // 之前结构写错,现在只能保持这个错误了. static SizeGuard< sizeof( SPlayerExpand ) == 4104 > // 当条件为false时,进入SizeGuard(),则下面的ck1必然失效 ck1( "正在检测SPlayerExpand的数据结构大小" );