函数重载有关问题:“不明确的用户定义的转换”

函数重载问题:“不明确的用户定义的转换”
我还在用C++模拟AS3.0的一些特性。

面向对象语言中的一切都是类,所以我定义了一个类Object作为所有类的基类。类UndefinedType,模拟了没有指定类型的情况。
Object可以直接给给其他类型赋值,或者说可以直接转换成其他类型,当然若无法转换,会抛出异常。

为了方便,我要重载operator bool ,operator int ,operator unsigned int……

当把UndefinedType作为CMap的key的时候问题来了:
1>E:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxtempl.h(163) : error C2440: “类型转换”: 无法从“const FlashType::UndefinedType”转换为“DWORD_PTR”
1>        不明确的用户定义的转换
1>        E:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include\afxtempl.h(1542): 参见对正在编译的函数 模板 实例化“UINT HashKey<ARG_KEY>(ARG_KEY)”的引用
1>        with
1>        [
1>            ARG_KEY=const FlashType::UndefinedType &
1>        ]

我是这样做的:
typedef CMap<UndefinedType,const UndefinedType &,UndefinedType *,UndefinedType *> DictionaryAttribMap;
然后重载了:
template<> UINT AFXAPI HashKey<const FlashType::UndefinedType &>(const FlashType::UndefinedType & key);
template<> BOOL AFXAPI CompareElements<FlashType::UndefinedType, FlashType::UndefinedType> (const FlashType::UndefinedType * pElement1, const FlashType::UndefinedType * pElement2);


当我只对Object类重载重载operator bool ,operator int 中的一个时,跟踪调试,能进入我重载的HashKey。而operator bool ,operator int 两个都重载时,就无法通过编译了,不明确的用户定义的转换。
请问是什么原因?要如何修改?
编译器是:Microsoft Visual Studio 2008
------解决思路----------------------
帮结帖并蹭分