this == null; surely not, but yes
- by pm100
I would have said that this will segfault but apparently not
#include <stdio.h>
class foo
{
public:
bool thingy() {return this == 0;};
};
int main()
{
foo *f = 0;
if(f->thingy())
printf("eating hat\n");
}
I just expect that 0-xxx will never work.
I assume that if we had to do some vtabling it would fail; obviously cannot access any member variables either
edit; sorry - no question there. THe question is "are you surprised like me?"
and it seems the answer is yes. even though nobody said yes. I got
a) of course this will work
b) of course this will never work
c) it is undefined behavior; your mileage will vary