Original Post
So, pretty much I can sum this up in code.
Notice in the second one, I'm just comparing pointers!
This should work in all cases (where the pointers point to the same thing) right?
It seems too useful to be true.
My test program seems to work fine but is there some reason I shouldn't do this? (before i convert over loads of code)
void FindThingInArray (Thing* thing)
{
for (uint32 i = 0; i < vector.Count (); ++i)
{
if (vector->GetID () == thing->GetID ())
return i;
}
}
Notice in the second one, I'm just comparing pointers!
void FindThingInArray (Thing* thing)
{
for (uint32 i = 0; i < vector.Count (); ++i)
{
if (vector == thing)
return i;
}
}
This should work in all cases (where the pointers point to the same thing) right?
It seems too useful to be true.
My test program seems to work fine but is there some reason I shouldn't do this? (before i convert over loads of code)