Re: VC8 Compiler bizarreness



Murrgon wrote:
class TTexture;
typedef TSmartPtr<TTexture> TTexturePtr;
typedef TArray<TTexturePtr> TTexturePtrArray;

TTexturePtrArray apTextures;

I am having the most bizarre compiler error. Code that has been
working for years all of a sudden, in one particular case, throws a
compiler error:

for (UINT i = 0; apTextures.Size() > i; ++i)
{
if (NULL != apTextures[i])
{
// Do something
}
}

error C2593: 'operator !=' is ambiguous

As this is dealing with templates, the compiler comes along and
tells you what types it thinks might fit. The weird part is, none
of the suggested types have anything to do with a TTexture. What? I
don't know how the compiler resolves the types, but something is
messed up.

Do any of the suggested types have an operator!=()?

Recently added?


Bo Persson


.