While this is C++, I've actually seen this particular construct: delete new SomeClass(...);
used as, basically, an eye-poppingly clever way of initializing something, doing work, and then cleaning up after.
{ SomeClass makeitso; }
Also, free(ptr++) is broken by design, the post increment value is useless. But free(*ptr++) is a good case.
Yes, of course - that's what I thought I'd written. Clearly not :)
While this is C++, I've actually seen this particular construct: delete new SomeClass(...);
used as, basically, an eye-poppingly clever way of initializing something, doing work, and then cleaning up after.