本帖最后由 CC2530 于 2011-7-5 09:46 编辑
template <typename T> class UINT_OBJECT
{
public:
union
{
T var;
volatile T Var;
};
};
template <typename T,char b>
class UINT_BIT_OBJECT:public UINT_OBJECT<T>
{
UINT_BIT_OBJECT<T,b>(T value)
{
if(value)
{
Var |= 1U<<b;
}
else
{
Var &= ~(1U<<b);
}
}
};
Error[Pe020]: identifier "Var" is undefined E:\HWT\HWT_Scheduler\HWT_Scheduler\utility\util_uint_object.hpp 319
//IAR编译不通,不知道为什么? |