I have a small piece of code which does something funny, but I can't ... This is undefined behavior. The first iteration, ptr points to "object" .
stackoverflow.com